Triac based switching with reverse voltage protection
The first thing to check is make sure the HLK-SM05 is providing the correct 5V output that is constant, I also don't see any bypass power capacitors on the schematic which could also be causing brownouts on the board. The voltage to the MOC3021 should also be constant.
If those are constant then start looking at the snubber.
With inductive loads the triac doesn't shut off because the voltage cycle and current cycle are not in sync. So it may be necessary to adjust the snubber for the load by having an RC snubber with an adjustable resistor as show and described in this article:

Source: ST AN308: CONTROL BY A TRIAC FOR AN INDUCTIVE LOAD HOW TO SELECT A SUITABLE CIRCUIT 
You could also change the resistor until it lines up, usually triacs need an RC snubber.