https://marlinfw.org/docs/gcode/M000-M001.html This might explain a thing or two about what you are trying to accomplish.