My Z axis homes to Zmin when i use settings as shown on the screenshot. I dont think that is the problem here, because first few lines of code are executed correcty (including Z homing cycle).
I could replace M8 and M9 commands with anything else and I’m pretty sure that program wouldn’t work correctly. I’m using M8 and M9 to control 3,3V arduino relay, which further controls 12V air valve to move probe tool down and up (enabled, disabled).
I’m currently trying to replace G28.2 with G38.2 for Z probe. It fixed the problem with skipped lines, but I’m having issues with X and Y axis going out of workplace. I will try to figure that out.