Are your phase cables and signal cables shielded?
If not you may find that noise is being picked up on the signals.
This may be hitting the direction signals and causing one of the x axis to be changing direction?
disconnect the direction signals on the x axis and see if it still happens.