Hi,
you need to have a bit more work here. Because you need to constraint the camera position. So get the distance between the target and the camera, that's the float you need to watch. And if it goes out of bound, simply stop affecting the zoom. That's how I do it.
if you want to use clamping, then you need to get that z distance, clamp it, and then reassign it to the camera z position.
Bye,
Jean