A couple things.....
First off, your coding is fine.
Next, they need to take a look at the transmission. Sounds to me that its gonna be a couple things. After 11 years, when the spindle was pulled out, they should have checked the condition of the gears. If it ever ratcheted, more than likely, the mesh isn't where it needs to be anymore. It doesn't take too many ratchets to have the gears get chewed. This can also happen when the new spindle was installed and the mechanic was checking the tranny and it ratcheted.
Another thing,... spindle stack up is wrong or short.
The way to check this stuff it to do this. Roll up the Y axis cover. Stick your head in there to get a look at the tranny. You'll see two gears (one on from the spindle, one coming from the tranny/rotor). Check the engagement. The teeth engagement should be well covered. If the engagement is only at the top half from each gear, its not enough.
If the gear looks good here, it may be the shifter. You have two gears, one to one (M39), and some other ratio for M38. Possible that the tranny may need to be rebuilt. Electrical problems for this instance is not too likely.
Either way, IMO, it's not your program.