We can update this ticket later but for now I will leave a reference to this comment:
Unfortunately, the way that SubscriptionManager sets destroy on the middleware is odd. This forces me to store that anonymous function elsewhere so that I can still call it after wrapping/replacing subscriptionManager.middleware.destroy to ensure it also calls this.#unsubscribe.