@OwenD i think i kinda figured it out i changed a few things in your mesh.g, it still acts odd at the end but it works without crashing the probe now. after the mesh it wants to go to the center of the bed, than dock the probe, than center of the bed, than undock the probe, than probe datum z, than dock the probe.
; set Z = 0 to centre of probe area
; echo "Call deployprobe.g macro"
M401 P0 ; This runs macro file deployprobe
G1 X{var.ProbeCenterX- sensors.probes[0].offsets[0]} Y{var.ProbeCenterY- sensors.probes[0].offsets[1]} Z{sensors.probes[0].diveHeight+5} F600
G30
echo "Mesh probing"
M557 X{var.m557MinX,var.m557MaxX} Y{var.m557MinY,var.m557MaxY} P{var.ProbeNumX,var.ProbeNumY} F9000
if result != 0
abort "ERROR: could not create mesh"
else
G29 S0
if result != 0
abort "ERROR: Mesh probing failed"
else
echo "Mesh probing successful. Loading mesh.."
G1 H2 Z30 F2000 ; lift Z relative to current position to clear any obstructions
; set Z = 0 to centre of probe area
echo "Reset Z datum in mesh centre"
G1 X{var.ProbeCenterX - sensors.probes[0].offsets[0]} Y{var.ProbeCenterY - sensors.probes[0].offsets[1]} Z{sensors.probes[0].diveHeight+5} F600
G1 H2 Z30 F2000 ; lift Z relative to current position to clear any obstructions
; echo "Call retractprobe.g macro"
M402 P0 ; retract probe
G30