Stepper, limit switch and homing sequence. Problem with a false signal that triggers the loop

driver: https://www.brainy-bits.com/post/homing-stepper-motors-using-the-accelstepper-library
(since im new here im limited to the numbers of link so here it is)