If you swap all 3 cables related to the Z axis (motor, encoder, and limits) with another axis such as X, and it doesn't move the axis error, then it's one of three things:
1) the emergency stop cable going to P123 on the motherboard is unplugged, or the cable is damaged (not completing a...