xTool D1, non-pro, cutting lines works fine, but engravings are always shifted a few mm

Perhaps Fast Whitespace Scan is On and, if so, is set absurdly high:

At a more basic level, if the X Max Speed or X Max Acceleration are set beyond what the machine can handle, perhaps because it’s carrying a heavy laser head, it will encounter problems during laser-off moves with G0 commands.

On the gripping hand, XTool’s G-Code interpreter is known to introduce bonus jank, so updating to their newest shiniest version may help: