Scene Depth not available when SceneCapture2D is turned 180-degree

We are seeing very strange behavior. We use “Camera Relative Position World” node in material on SceneCapture2D component to get the depth view of the scene and render it in left most sub-window as shown below:

This works well in different environment except in one environment when we turn the SceneCapture2D 180-degree around and then see blank:

So basically, when we turn SceneCapture2D around, it still can capture visual scene but depth is suddenly all 0.

Any idea why this could be happening?

This turned out to be issue in my code. Basically screen depth becomes -ve when you turn around. So I’d to use Abs() function in material.