Photogrammetry and "difficult" contour lines
Metashape, like GIS software, builds contour lines from a DEM, so overhangs and hidden parts drop out. Why, and how to handle complex 3D features.

The photogrammetry software Agisoft Metashape (formerly PhotoScan) creates the contour lines of the modelled terrain using a digital elevation model as the basis for the calculation: the DEM, short for Digital Elevation Model.
If you have a complex 3D model, with vertical faces and overhanging parts, Metashape (like most photogrammetry software) generates the contour lines from a digital elevation model created beforehand.
GIS software does the same.

In this image you can see the contour lines of a vertical cliff, with overhangs, generated by Agisoft Metashape.
It comes from a photogrammetric survey and the resulting 3D model of the Riomaggiore (SP) landing, in the Cinque Terre National Park.
The DEM, being a raster file, is a two-dimensional object that divides an area into identical square cells.
For each of them you know the side of the square, the coordinates of the centre and the average elevation of the points within each element.
The contour lines are calculated from there.
But this step, from 3D to a 2D digital model (or rather 2.5D), prevents contour lines from being generated for hidden parts of the terrain (like a cave or a recess), because “what is on top covers everything underneath”.
And in the end that is a good thing, otherwise you would get tangled contours!
It is better to handle complex 3D features with software designed (or nearly) for this, relying on points or triangle meshes.