Multiple steppers including limit Switches does not work

The basic logic of such an application is
running a loop at high speed continiously to be able to check for limit-switches all the time and with quick response and to switch ON / OFF step-pulse-creation controlled by boolean variables.

Threre are different approaches to create such a functionality.
What precision do you want to have?
Would 2 mm be enough? or does it have to be 0,01 mm?

Did you do real tests if your stepper-motors are able to start / stop at a constant step-pulse-frequency of 2000 pulses per second under load?

if the frequency is too high the stepper-motor just won't rotate.
If you want the objects to move pretty quick you might need acceleration decceration.

best regards Stefan