Depth of Field Exclusion - Post Processing Material Issue

Hey guys. I’m using a post-processing Volume with a Depth of Field applied to it. It’s working fine, but I’m wanting to mask out certain object from this effect using the Post-Proocessing Material. I’ve seen that there is a “DepthofFieldFunction” node, but I am unsure how to use this, or set this up correctly. I have already masked out my objects using stencils, and I wish to use this to also mask out the DoF.
I feel like all this is wrong, but I’m just not too sure how to approach this:

I have already assigned the objects I wish to affect their own Stencil layers, as well as Custom Depth Pass (enabled this as well in the Project settings).