Ditto to above advice -- likely door pin switch has become intermittent and is not connecting the single power lead to a good solid ground connection, once the door is opened and the switch is released.
Pull the switch out of the door jamb, and scrape on the areas:
1) around the two metal surfaces that contact once the switch is released, when door is opened,
2) around the outer "shell" of switch where it contacts the steel body of the door jamb,
3) as well as the door jamb steel around the hole that the switch fits into -- sandpaper or the sharp edge of a flat-blade screwdriver will work.
May wish to spray with some electronic contact etcher/cleaner as a final step.
intothegoodnight