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
I have listed the whole file here.
; LightBurn 0.8.07
; GRBL device profile, current position
G00 G17 G40 G21 G54
; Cut @ 1500 mm/min, 90% power
; return to starting pos
Glad I have at least got to the root of this problem.