You should get the distance between the camera and the mesh, not the camera and the target.
Actually I would recommend removing the controls from the scene while you are working on this, and if you do include them, disable them while doing the zoom. Using
OrbitControls while doing camera animation is tricky.
You can get the camera distance to the mesh like this:
const a = new Vector3();
const distance = camera.position.distanceTo(a);
Although in this case, you can also just leave the mesh at (0,0,0), then do:
camera.position.set(0, 0, 1);
Then the z-depth will be 1.