This may or may not be a fix for your problem.
The safety/cutout switch is usually turned on by closing the lid whereby the protruding “thing” on the front (side away from the control panel) goes into a slot in the top assembly that allows the switch to work. The switch mechanism for this is under the slot in the top-cover. The mechanism is held in by one or maybe two screws. If the screw(s) loosens and allows the switch mechanism to become floppy, the thing protruding into the slot may not properly actuate the switch.
You can fairly easily get to the switch mechanism. FIRST unplug the washer from the AC outlet. It’s best then to remove the lid, but probably not totally necessary. So either remove or hold/prop the lid open so you can access the two, small (about 1 inch, 3 sided) rubber-like covers on the far right and left side of the top near the soap and bleach dispensers. You gently pry them out with a screwdriver or the like.
Under each of these covers is a Philips head screw that you need to removed. This allows the large top assembly to rotate upward to access the switch mechanism and its screw(s) in the front, center of the top assembly. There should be a wire going into it. Hopefully the screw(s) is loose and just needs to be tightened to secure the switch mechanism. (Also, check that the switch wires are properly tightly connected to the switch mechanism, although this is not likely the cause of your problem.)
Good luck.