DIAGNOSIS The door lock assembly (part number DD97-00645A) is faulty. The internal solenoid or microswitch is failing.
FIX Replace the door lock assembly. Unplug washer. Remove the door boot seal clamp and peel back the boot from the front frame. Unplug the connector, remove two screws, and swap the unit.
IF THAT DIDN'T WORK Check the wiring harness between the door lock and main control board for damage. A broken wire can cause intermittent lock signals.
HEADS UP Never bypass the door lock. The washer will not fill or agitate with an unsecured door. It's a safety feature.