One of ten 74HC595 shift registers have wrong output state when clocking in data
I have known for decades that CMOS FF's and shift Registers alike can be toggled with EMI on the outputs feeding back into internal inputs. 

So clean up your signals with common mode de-coupling, grounds, shields, add Ferrite CM chokes and differential ferrite beads and make all high current loops low EMI twisted pair shielded loops with clamp diodes and RC snubbers.

in some cases where RC driver filter latency , different on each pulse equal to the rise time or more can scatter synchronous glitches so they do not superimpose.

Remember that coil turn off pulse may cause high current or voltage fields due to L dI*dt



Just as twisting switched current wires together can reduce the pick up of radiated noise, twisting power wires together can reduce the amount of noise radiated by the wires in the first place. This is especially important with long power wires, such as those feeding switched inductive loads.