How do I replace “stepper_z” with “stepper _z1” with a macro?

As far as I’m aware, this is not possible. Klipper even automatically synchronizes stepper_z and stepper_z1 as it assumes they belong to the same axis.

Depending on what you want to achieve, you may try a manual stepper definition or check New generic_cartesian kinematics (incl. CoreXYU/CoreXYUV, generic IDEX and AWD) if this can offer a solution.