Unwanted laser lines

how do these unwanted connecting lines arise

What version of GRBL are you running?

If older than 1.1f then make sure you’re using GRBL-M3 for your device type.

If you are using 1.1f or newer then make sure you are using GRBL device type and enable $32=1 in Machine Settings.