OK, a bit more investigation and I have found the cause. Sorry if this is a long post.
The setup is run with a relay to turn on vacuum and send 240v power to a 12v transformer to power laser.
M4 is sent first (PMW at zero)
When the M7 (spindle) command is sent, the laser is sent 12v, but under PMW Sxxx power control, so live, but zero laser output power.
When S229 (for90%) is sent it is preceded with a move command (G1Y62.41S229.5F1500)
the command sequence in the gcode file here runs through so quick that the command M7 is followed up by the G1Y62.41S229.5F1500 line and the relay introduces a very slight delay, so the command to move and instantly turn on laser is thwarted by the laser not being in a powered state for a bare fraction of a second.
By powering the laser ready bypassing the relay, the line G1Y62.41S229.5F1500 works instantly. I believe the sequence ‘relay on, send 240v to transformer, send 12v to laser’ is not instant enough.
My previous method of working with Vcarve had a second of delay at M7 added by G4 to allow the vacuum to kick in before powering my spindle. This also worked for the a delay for laser to get 12v power.
I can overcome this for now by manually switching the relay vacuum power on (which also feeds laser 12v power) in advance of sending the laser cut. This also explains why it only causes an error at the very first cut, the laser is in ready mode till the end of the cuts when m9 is sent.
One more quirk of Lightburn, with the laser stationed at origin, when the cut command is sent it goes to the right and up diagonally, returns to origin, then cuts the square.
Why does it add the lines at the start
G0X28.81Y14.71
G0X-28.81Y-14.71
I have listed the whole file here.
; LightBurn 0.8.07
; GRBL device profile, current position
G00 G17 G40 G21 G54
G91
M4
; Cut @ 1500 mm/min, 90% power
M7
G0X28.81Y14.71
G0X-28.81Y-14.71
G1Y62.41S229.5F1500
G1X66.57
G1Y-62.41
G1X-66.57
M9
G1S0
M5
; return to starting pos
G0 X0Y0
M2
Glad I have at least got to the root of this problem.
Phil