Get a wiring diagram and look at the switch logic. You can temporarily jumper the switch and see if that stops the periodic shut down. If it does replace the switch.
Also look at the activation method of the switch. Sometimes the plunger wears down and cause intermittent. Or the hardware side tweeks from age and doesn't hit square.
Also look at the activation method of the switch. Sometimes the plunger wears down and cause intermittent. Or the hardware side tweeks from age and doesn't hit square.