ok, so without truly understanding what you are trying to do, 2 things spring to mind:
1 - use "get altitude in texture" instead
2 - get altitude will always return 0, because TG2 will continue to assume a perfect sphere, as you haven't computed the tex coords yet in this chain of nodes.
Just remember that you need to "tex coords from xyz" whenever you try to call the altitude in the texture, also when you want to work with an altitude constraint.
Compute normals if you need to use slope constraints for something.
Compute terrain when you need both correct altitude and slope constraints
Hope that helps a bit,
Frank