In my experience the micro switch is blamed for a lot of issues that are actually cracked solder joint within the locks electronic side. The use of lead free solder (devils materials) is to blame as it is not malleable like leaded solder is and over time the loom flexing is passed into the electronics part of the lock assembly and ultimately to the connector to circuit board joints. It doesn't help that these are quite thick leads compared to the others on the circuit board so when it is flow soldered in the manufacturing process these thicker legs will not get as hot as the thinner legs and thus the soldered joint is more susceptible to clacking
The joints can be heated up, suck off the lead free solder with a solder sucker and flux and reflow with leaded solder, clean up the board with some isopropanol and yours good to go. You can test it before reassembling the lock in the door.
Cheers,
Paul