Closest device to a group of zones

Hello,

For a long time (over a year) I had a working automation based on a distance from a tracker to closest zone in a group.

{{ (distance('device_tracker.320i_xdrive', closest('device_tracker.320i_xdrive', ['group.sppn']) ) * 1000 )|round(0, 'ceil') }}m

Since version 2022.5 (or so) is stopped working. It’s probably connected to changes in zone state.
So, does it suppose to work? Here is documentation Templating - Home Assistant and it’s true I don’t see this specific kind of example.

The use case here is I have a few parking meters as zones. I need to know the closest parking meter to my parked car to check if it’s parked close enough to be counted against my subscription. If it’s not, push notification to avoid parking ticket.