MSAA not working with custom Post Processing (CustomDepth)

The most likely cause of this problem is that scene depth is being calculated per MSAA sample, while custom depth is being calculated only per pixel, so in places where scene depth varies across different samples on the same pixel, the scene depth and custom depth will not be equal.