The lock mechanism could be prevented from engaging by debris in the lid lock assembly. Plug the washer and check the wiring. You usually need to replace the door lock/switch assembly if you find no wiring problems.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.