It looked at first like failure of the middle of the three switches that sense the open/close status of the door. Replacing this restored function for a day or so, until the problem returned. I noticed that slight wiggling of the door could close and open this switch. Looking closely at the "lock" it appeared that the ramp that the door catches slid up were worn at the inside edge. The replacement part confirmed that the end of this ramp was worn. This apparently causes the sequence of switch closures to sometimes go wrong. It has only been a few days, but looks like replacing this part did the job. Why an expensive microwave would contain a part made of inadequate plastic, leading to failure in 5 years, is a good question.