Microcontroller freezes randomly when switching on a relay (snubber inside)

You mean that I should connect the snubber in series with the load? I followed this schematic:

image

I saw this connection method in many posts about snubbing an ac load with a relay.