What I learned you can not have a A motor as Slave to your X. Your motors are setup with Motor 0, Motor 1 and so on and then assigned to the axis. Take A motor out all together. Then whatever motor # you want as a Slave to the X motor number add that as Slave. You still have the 4 motors, only one is a slave. I am using direct drive screws, if I was using belt drive to rack and pinon the Slaved side might need reversed, just a Click in the setup screen. No big deal.
Your Z problem might go away after all this, if not check the wiring.