Hi Kheka,
Have you fixed your issue yet?
I had what I believe is the exact same problem: Custom depth buffer causing objects to draw in front of other objects - Rendering - Unreal Engine Forums
Which I think I have now fixed. If you can post a screenshot of your post process material, I can see if my solution is relevant to your issue.