So I had some time to actually look at this:
Code:
; -------------------------------------
; --- Begin Initial data gathering ----
; -------------------------------------
; --ANDY #<tool> = #<selected_tool>
; --ANDY #<pocket> = #<selected_pocket>
#<tool> = #<_selected_tool>
#<pocket> = #<_selected_pocket>
#<local_start_x> = #<_x>
#<local_start_y> = #<_y>
#<local_start_z> = #<_z>
#<_x>, #<_y>, #<_z> are relative positional values so your start position depends on whether you have g43 tool offset active or not.
The routine is set up to always return to the start position with G43 active so if your start position was stored in G49 then your spindle will always have to travel further up by the measured tool offset then where it started. This is why you are getting limit violation errors.
Just calling G43 is not the right way to go about it. If you have no tool set then the offset will just be zero and you'll be no better off.
Basically you need to start out by setting up your probe length in the tool table (ie Z offset for tool #99) and then do 'T99 M6 G43' or, if your probe length has to be measured after each startup, you may want to use 'G43.1 H...'
linuxcnc.org/docs/html/gcode/g-code.html#gcode:g43
So really the same the others have already pointed out but it has taken me a long time to catch on.