What I’m proposing (having seen it in the wild) is that the shaft can rotate slightly inside a pulley / coupler, with the (slightly not snug) setscrew stopping the flat in either direction. The shaft position depends on the history of how it got there, so running the same job will produce pretty nearly the same errors at the same points.
Which makes it look like a software problem, because we all know hardware can’t behave like that.
Bingo! If it can move freely, it’s a source of positioning error, because the controller does not control where it is.
Consider this tale of woe:
I’m going to elevate that problem up in the debugging checklist, because it seems regrettably common.
Fixing it may require some derring-do with a box of metric screws, but you’ve found at least one problem!