The usual cause is dU/dt,
Try adding a snubber network (series R / C, ballpark values 10nF / 22R) across the triac, if this solves the issue, dU/dt was the cause.
In a dimmer circuit, look at what kind of load you've connected and wether the dimmer is suitable for the load. E.g. some (especially simple) dimmer circuits require the load to be mostly resistive (like a tungsten light bulb) and won't work well with a modern LED lamp.