If the motor shaft is out of position at the end, doesn't this sound more like an electrical problem?

1/8 turn is about 0.6mm error - is that about right?

I think you said 320 steps per mm, which would be x8 microstepping with a 5mm lead ballscrew - sounds about right. So, 1600 steps per rev. 1/8 turn is 200 steps - that's a lot! Does this happen with air cutting? If so, can you slow the max speed and acceleration right down to remove the chance of it being missed steps? Is the error always exactly the same each time you test it, or does it vary quite a lot? Does it happen with the spindle running and spindle stopped?

Out of curiosity, where does the gcode come from? As I mentioned earlier, I had a similar problem when I first started setting up my own router, although in my case the error was much smaller (although still cumulative) and I'm trying to think through a logical sequence to try to narrow down the problem.