As a workaround::
you can extract the Z-depth to greyscale values, precompose that and feed it into a filter that uses greyscales to Blur selectively.
There’s a third party-filter somewhere called Rack-focus that does that.
I’m sure there are some Lensblur filters out there with the same functionality
After Effects comes with ‘Compound blur’, which does not use a “centered Focus point” like rack focus, it always blurs 0 pixels at black, max pixels at white (or vice versa), but you cannot say : “don’t blur at 50% grey, but do blur at 0% black and 100% white”
The workaround for that would be to create a “solarized’ greyscale map.
I’ve created an example-project that does that, with two depth matte filters, and a channel combiner to turn the alpha-matte into a greyscale.
It uses a few sliders and expressions to make the process easier to control, but they’re not really necessary.
You get sliders for “Focal Plane”, “Focal Thickness” and “Focal plane feather”
download the comp at: https://www.vandueren.be/forumstuff/3dfilters/