I only know about welding on cars.
It can go wrong, mostly it doesn't
I describe her the reason why it can go wrong:
Welding invokes HF AC currents.
As many know, a battery acts as a wire for HF.
So the currents go throug the wires, and can invoke a dangerous tension over other components like alternators, ecu,...
So it's always safer to disconnect the battery.
In your case, I don't know your setup:
When you disconnect all wires from your machine, leaving the steppers or servos on it, but disconnected, you're safe.
When you weld without disconnecting and keep the mass clamp close to your welding area, you're nearly safe.
Follow also the path of current.
Welding on the X-axis, while having the clamp connected to the machine base, makes the current go througt slides, bearings, spindles... not good.