Buffer Visualization for Custom Depth not working

I am trying to use the custom depth pass to draw outlines on specific objects. The PP material works fine on a new blank Project, but on these two specific Projects, it just won’t render any of the marked actors in the custom depth pass. This person seems to have had a similar issue: Buffer Visualization - Custom Depth not working - Programming & Scripting - Epic Developer Community Forums

I have tried going to the Rendering options and enabling the “Custom Depth-Stencil Pass” in the Project Settings (which was off) but that sadly didn’t fix the problem. Does anyone have an Idea about what might cause this behavior? The image below might explain the problem:

Thanks in advance.

I’m having this same issue. No clue what’s causing it.

I’m having the same problem. The custom Depth Buffer simply don’t work at all. material and project settings work fine in an older project, but not in my actual project. Error first encountered in 4.15. A working 4.14 project converted over into 4.15 works.

I had the same problem, none of the buffer visualization worked.
My solution was to check Show → Post Processing → Post Process Material inside the editor.
I previously unchecked them because I didn’t want the blur and other post process effects enabled.