Just some tips, ALWAYS use lower case o for the Sub name(o123) once you use it it comes obvious as to why
Either use cap G or lower G but not both
You cannot use Z-#var MACH3 will error you must solve the #val as a neg value such as Z [-1*#3] YES it does not comform to standard Gcode BUT that is just the way Mach3 does it. The Z- in this case should indicate a neg DIRECTION call but it does not(;-)
Double check for end brackets on comments
Limit Comments to criticle issues (;-) Gcode is not a diary. Makes it hard to follow with all the comments jumbling up the code AS mach3 does NOT handle comments correctly for display. It should maintain the Gcode line to comment relationship BUT it just zipps to the end of the comments and stays there.
Correct the notes in the returned file (notes are in the file) and it should run ok.
(;-) TP