What kind of controller is this? Can you write your own logic for the G and M codes?
M1 and M2 are typically reserved for special functions in gcode programs. I wonder if a conflict in logic could be occurring? M1 is pause and M2 is program end. Use perhaps M8 and M9 (typically assigned to coolant), but not M1, M2, M3, M4, M5, M6, or M30
First you get good, then you get fast. Then grouchiness sets in.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)