Someone on a different platform gave me the answer.
In case anyone finds this post later, here’s the solution:
There’s an Opacity Mask Clip Value under Material → Advanced, which as the name implies prevented anything being rendered in the CustomDepth buffer under that opacity value.
Changing this value to 0 was the solution for my use case.