These are really a very simple switch, but that is also why the cause problems. As they get older they build up some corrosion around and under the screw, and the plunger wears getting loose. What this all means is they no longer make contact. All they do is provide a ground when you open the door. The screw that holds them in place is actually the point of contact. To ensure the circuit is working properly remove the switch and using a jumper in the end of the connector ground the wire directly. If that works you don't have a circuit problem, clean or replace the switch. When they wear they can be very irritating by their intermittant operation.
my 2 cents,
AF