Microswitches are normally VERY repeatable.
Unfortunately, the typical lead screws in 3d printers are not so repeatable - better if the design includes a backlash nut, but still nothing to write home about. Note that it is possible for the x-axis to get "cocked" at a bit of an angle; you can adjust the bed to match, so it is "level" ... but that cocked position will further degrade the repeatability of z-axis movement.
Making sure everything is tight is an excellent suggestion! Maybe time to do a complete tuneup - all fasteners tight, belts and rollers properly tensioned, z-lead-screws synched to get the x-axis square to the motion, rails cleaned, etc.