I just double checked, and can confirm that changing

M574 X1 Y1 S0 ; ```to

M574 X1 Y1 Z1 S0 ;

Edit: Ohhh I figured it out. M558 P4 is set to use the E0 endstop, but I had the probe plugged into the Z endstop.