Based on #7792 by @tcm0116
@ -3193,6 +3193,8 @@ static void homeaxis(const AxisEnum axis) {
// The current position will be the destination for E and Z moves
set_destination_to_current();
stepper.synchronize(); // Wait for all moves to finish
if (retracting) {
// Remember the Z height since G-code may include its own Z-hop
// For best results turn off Z hop if G-code already includes it