@RyanRoberts welcome to the club, last time I did this, I think I bought 4 extras as spares (which kinda shows that it wasn’t the first time I’d done it).
Limit switch issues is getting into the tech side of things upon which I’m not qualified to speak with anything other than generic suggestions.
Is the switch wired the same as all the others? Some have both “Normally Open” (NO) and “Normally Closed” (NC) terminals on the same switch, if you’ve inadvertently picked the wrong the wrong pair, yes, I guess you’ll get an alarm. Check that the switch operates (using a meter) in the same manner as all the others.
Does a $X reset fix the problem? If it does, before you home the machine again, make sure you give it the $H home command and then trip the Z Axis switch by hand before the carriage hits the switch and breaks it off again. If the switch is wired wrong (or faulty), and you override the alarm, you risk having the Z Axis move upwards again and then not being stopped by the faulty switch, breaking it off again…
later edit - use a pencil or something, don’t put your fingers into the machine!!
After this, I’ve no idea. Search the forum (for example here Limit Switches - #26 by sketch42 ) there’s lots of really good stuff already on the forum.
Failing that, contact @LarryM (I’ll hope he won’t mind me suggesting his name), Larry appears to know a huge amount regarding the wiring & operation of the electronics & general machine related info. He’s been a great help to me and he regularly appears on the forum as someone who always has good, thoughtful and practical advice.
Hopefully it’s something simple.