Getting issues on Stepper motor with limit switch

I am using 3 stepper motors with DM542 driver to build a pick and place robot using Nucleo-F746ZG. For the movement of stepper motor I am using this library :-
Continue to this issue. I am using limit switches to have a reference point for accurate and precise navigation. Now the problem i am facing is X and Z stepper working fine with limit switch but Y- stepper is not even taking step.
My limit and movement logic is

void X_stepper_Move(int move,int acc)
{
    X_Stepper_Relay=1;
    Y_Stepper_Relay=1;
    Z_Stepper_Relay=1;
    printf("\n\n Robotic Arm XY Stepper");
    X_Stepper.enableOutputs();
    wait_ms(10);
    X_Stepper.setAcceleration(acc);
    wait_ms(10);
    X_Stepper.moveTo(move);
    wait_ms(10);
    while(X_Stepper.distanceToGo() != 0){
    X_Stepper.run();
    if ((X_Stepper.distanceToGo() == 0)) {
        wait_ms(10);
        X_Stepper.stop();
        wait_ms(10);
        X_Stepper.disableOutputs();
        }
    }
}

void Y_stepper_Move(int move,int acc)
{
    X_Stepper_Relay=1;
    Y_Stepper_Relay=1;
    Z_Stepper_Relay=1;
    printf("\n\n Robotic Arm YZ Stepper");
    Y_Stepper.enableOutputs();
    wait_ms(10);
    Y_Stepper.setAcceleration(acc);
    wait_ms(10);
    Y_Stepper.moveTo(move);
    wait_ms(10);
    while(Y_Stepper.distanceToGo() != 0){
    Y_Stepper.run();
    if ((Y_Stepper.distanceToGo() == 0)) {
        Y_Stepper.stop();
        wait_ms(10);
        Y_Stepper.disableOutputs();
        }
    }
}

void Z_stepper_Move(int move,int acc)
{
    X_Stepper_Relay=1;
    Y_Stepper_Relay=1;
    Z_Stepper_Relay=1;
    printf("\n\n Robotic Arm ZX Stepper");
    Z_Stepper.enableOutputs();
    wait_ms(10);
    Z_Stepper.setAcceleration(acc);
    wait_ms(10);
    Z_Stepper.moveTo(move);
    wait_ms(10);
    while(Z_Stepper.distanceToGo() != 0){
    Z_Stepper.run();
    if ((Z_Stepper.distanceToGo() == 0)) {
        Z_Stepper.stop();
        wait_ms(10);
        Z_Stepper.disableOutputs();
        }
    }
}

void X_stepper_Limit()
{
    X_Stepper_Relay=1;
    Y_Stepper_Relay=1;
    Z_Stepper_Relay=1;
    printf("\n\n Robotic Arm X Stepper Limit");
    
    X_Stepper_Limit.mode(PullUp);
    wait_ms(10);
    X_Stepper.setMaxSpeed(50000);
    wait_ms(10);
    X_Stepper.setAcceleration(3000);  	
    while (X_Stepper_Limit == 1) {
  	if (X_Stepper.distanceToGo() == 0){
		// X_Stepper.move(-30000);
        X_Stepper.move(30000);

      }
	X_Stepper.run();
    }  
    X_Stepper.stop();

}

void Y_stepper_Limit()
{
    X_Stepper_Relay=1;
    Y_Stepper_Relay=1;
    Z_Stepper_Relay=1;

    Y_Stepper.setMaxSpeed(50000);
    wait_ms(10);
    Y_Stepper.setAcceleration(4000);
    wait_ms(10);
    printf("\n\n Robotic Arm Y Stepper Limit");
    Y_Stepper_Limit.mode(PullUp);
    wait_ms(10);
    while (Y_Stepper_Limit == 1) {
  	if (Y_Stepper.distanceToGo() == 0){
		Y_Stepper.move(-20000);
      }
	Y_Stepper.run();
  }
  Y_Stepper.stop();
}

void Z_stepper_Limit()
{
    X_Stepper_Relay=1;
    Y_Stepper_Relay=1;
    Z_Stepper_Relay=1;
    Z_Stepper.setMaxSpeed(50000);
    wait_ms(10);
    Z_Stepper.setAcceleration(3500);
    wait_ms(10);
    printf("\n\n Robotic Arm Z Stepper Limit");
    Z_Stepper_Limit.mode(PullUp);
    wait_ms(10);
    while (Z_Stepper_Limit == 1) {
  	if (Z_Stepper.distanceToGo() == 0){
		Z_Stepper.move(+20000);
      }
	Z_Stepper.run();
  }
    Z_Stepper.stop();
}