When removing a session, rather than a destination pattern based search, we should search for occurrences of the session id in the destination cache. It is arguably a more fail-safe way to guarantee the session is completely removed from the cache and would probably be more efficient.
A similar improvement could be made for individual subscriptions. When removing a subscription, search for occurrences of the session id in the destination cache, and then check if the subscription id is present.
In other words complete ignore destinations and focus on removing session and subscription ids.
#16549 DefaultSubscriptionRegistry does not update destination cache when subscribed twice to same destination