Have you grounded your dust collection hoses? I had static from my dust collection tripping my proximity switches. Part of the problem was my use of some PVC piping in part of the system. PVC is terrible, when it comes to static. Anyway, dust collection needs braided copper ground wire running all the way back to an earth ground.
Do you have an incoming line filter for your VFD? I had the same intermittent problem. I was cutting some hard maple hold downs with slots down the centers. The stick I was cutting made 7 hold downs. The first few were fine, but suddenly the X axis went negative and the slots were cut offset. Turns out it was noise in the incoming line. A line filter cured it.
I'm not an electrician or electronic technician, so I don't have elaborate equipment for measuring noise (EMI). I used an AM radio tuned off of any stations. If you have noise, you should hear it in the radio. I did. Without the filter, plenty of noise. With the filter, the baseline AM static didn't change - so the filter did what it was supposed to. Of course, if you have equipment designed to measure EMI, that's the best way to go.
The Old Man and the C - - -NC