When I change one of the Z's to depth
Well, changing a Z co-ordinate for depth is not correct. They are different things. If you previously used the ZElevation expression, use Z instead; if you used TotalZElevation, use TotalZ, and if you used ZHeight, use Depth instead.