This could be a problem with G28. It's not that G28 is evil but it depends on a machine having an established HOME position and a parameter in the control. The default parameter should be okay but when the operator is also the integrator who knows ? On my router I always HOME to an established machine origin at start-up and use work piece offsets (usually G54).
I like this explanation:
https://cncphilosophy.com/g28-g-code-demystified/
Of course you could also have a program without G28 and that's my preference.
This may not be the problem in your case but it sure sounds familiar.