Rats nest is not good when using low voltage signals
That could well be one of the issues as its easy for noise to get into the wires and affect things.
I think the motor tuning parameters for a slaved axis is irrelevant but I am not 100% sure so make sure the A is set to same steps per unit and Velocity/accel as the Y.
Even if the motor parameters dont matter I would think it is possible to change the active state of the Dir pin on a slaved axis to make it go the opposite way, if that is the case then the Dir LEDs may be correct with one off and one on as it will depend how you have the motors wired and also whether the motors are at the same end or opposite.
If Mach is indeed showing the position correctly when the axes go wild then I would say it is most likely noise or loose connections that are your problem.
Hood