Different elevations result of clampToHeightMostDetailed at same position

Hi,

If I have understood the documentation correctly, clampToHeightMostDetailed should always give the same result, no matter how high the camera is, right?
It should be use the maximum LOD.
In my sandbox, I have created my own terrain and set the camera to 2 different heights.
The clampToHeightMostDetailed function outputs different heights, which are visualised using the polylines.


Sandcastle

I would like to display a elevation profile as a chart, which is calculated by 2 selected points.
It should not matter in which camera position/height I am.
In addition, the elevation profile should refer to both the terrain and any objects that are displayed

Or how can my problem be solved?