I am not familiar with the newer Yaskawa amps.

When you calibrate the machine does the Z move? Can you jog Z before you calibrate? You should be able to jog Z with the machine uncalibrated - actually you should be able to jog all the axes with the machine uncalibrated. Even if a limit switch is active you should be able to jog away from it. So, if the +Z limit switch is active you should be able to jog -Z.

If Z never moves even when you jog it manually, you've got a problem with the servo amp, the servo motor, the encoder, or the wiring. The reason for the following error is because the control tells the axis to move and it does not.

If Z moves when you calibrate, then the Axis Following Error occurs afterwards there's almost certainly something wrong with the encoder.

So, please tell us if you can jog Z before calibrating, and if Z moves automatically when calibrating.