You’re probably thinking of the floor constraint. However if you’re using it on objects, it only cares about the location of the object, not the surface of the mesh, i.e. its origin point. With a plane mesh the origin is generally in the middle of the plane, so a constrained object won’t pass through the plane, but with something like a cube, an object can pass halfway through before it hits the stopping point. Also of course the constrained object behaves similarly; its origin won’t pass beyond the target object’s origin. So place those origin points strategically.
Alternatively, you can use the constraint on bones. In the case of bones, the constrained bone’s root will not pass the root of the target bone.