Bump.
This is a really useful feature, that can be done pretty easily in Unity/OpenGL.
I have found this: https://stackoverflow.com/questions/55917084/how-to-extract-scenekit-depth-buffer-at-runtime-in-ar-scene,
but there's no elaborate answer or an example that demonstrates how this can be done in SceneKit/RealityKit.