Washer works sometimes

The lid switch on this model is of the magnetic type. Leaning on it doesn’t normally do anything to it but if it is sticking, it may cause it to release. The main control board does not monitor the lid switch and there are no error codes indicated when putting the control board into service mode. The lid switch is monitored by the inverter board on top of the motor. If it doesn’t detect the lid opening within the last two wash cycles, it will disable the motor and will indicate an error via the flashing LED on the inverter board.

GE WH12X10334 Lid Switch Asm - AppliancePartsPros.com

Eric