This seems to be the solution, it’s from brent113 from the Snapmaker Forum. I can confirm it’s working!
I figured it out. Someone (maybe you) mentioned they suspected M9 was an issue, and that’s it.
Test 1:
Save gcode to file. Run file in Lightburn using ‘Run File’ button. Identical behavior to just using the Play button
Test 2:
Edit gcode file by changing M9 to ; M9 (comment it out). Run using “Run File” → works perfectly.
Theory → Lightburn sends the serial buffer data to the controller and expects an ok at the end. Instead, it received an “echo: error: M9 unrecognized command”. This causes lightburn to hang and not send additional gcode as it never received the OK.
When the file with the M9 is run from the touchscreen, it works as intended because the controller must send an OK to it, and it continues without regard to the unrecognized command error.
This is a bug in Snapmaker, not Lightburn, equivalent to a comment being typed into Luban causing it to hang.