@Pierrelito I'd also avoid the use of
G1 H2 X-5 Y-5 F6000 ; move back 5mmas well at that point your axis is homed so you can just use a normal (H0) move to back away from the endstop. H2 means use an individual motor move, which I'm not sure you want with a corexy printer.