Have you looked at the diagnostic screen for the +Z limit?
Push on it while watching the screen it should change from 1 to 0.
If the switch is OK, I would guess you have opened up the switch conductors somewhere, these limits are active low, they are normally closed so open the switch or break the conductor and you have an over travel.
The diagnostics screen and the Ladder, if you have it, are your two best friends.
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.