Devil's in the details
Years back, I worked for 3D Systems, supporting their old resin/laser-based stereolithography systems. Customer had just taken delivery a of shiny new SLA machine, and the elevator stage had a mind of its own, with the stepper motor bucking and intermittently running the opposite direction as commanded. Two regional support techs and their senior supervisor visited the site, replaced nearly every component in the subsystem, but still the problem persisted.
After three weeks of this, the customer was ready to crate it up and send it back. So - I'm dispatched with a one-way ticket to Oregon to figure it out. First thing I did was unplug/check/reseat each connector on the harness involved. Sure enough, in manufacturing one of the pins in a molex block had been improperly soldered to its wire, connected by just a few strands. Sometimes the motor got correct current to all windings, and sometimes it didn't. 15 minutes with a crimp and portable soldering iron and all was well. Cabling is always a playground for failure.