According to the documentation for depthTestAgainstTerrain:
The disadvantage of depth testing primitives against terrain is that slight numerical noise or terrain level-of-detail switched can sometimes make a primitive that should be on the surface disappear underneath it.
When depthTestAgainstTerrain is set to true, the issue you mentioned with the primitive disappearing underneath the terrain can occur. This happens when terrain LOD is switched. Unfortunately, it’s not possible to force the highest terrain resolution with the API (also, forcing this setting may lead to other issues with performance).
One soluton is to turn off depthTestAgainstTerrain, although that might introduce undesirable visual artifacts.