won't stop at which end? Switch end or the opposite end? Or both?
Have you continuity tested both switches? Do they pass?
If so, track the wiring to the controller and check continuity at the controller.
If it fails, you may have a broken X switch wire in the drag chain.
If it passes, re-attach to the controller, and try again.
If it still fails, and assuming the Y axis switch is working, move the gantry (if you can) to the lower corner opposite your home position, and shut the machine down. Reverse the X and Y wires at the controller. Turn on the machine, and while it's homing manually activate the switches.
If the switches and controller are working properly, the X axis switch should stop the Y travel, Y axis switch should stop the X travel...
IF the X axis switch DOES stop the Y travel, then X axis switch and wiring to the controller is okay.
If not, likely a broken X switch wire in the drag chain.
IF the X axis switch and wiring test okay above AND the Y axis switch DOES NOT stop the X travel, you may have a bad controller...
--This is based on how my Triumph 'acts' when homing, you may need to make some adjustments for your machine