Thank you for answering but the upgrade/downgrade flow works fine. The problem occurs when the Sandbox user tries to buy the subscription again after it was upgraded/ downgraded to another one.
It is possible to do it from Settings->Snbdbox account -> Manage. But it doesn't work from Product. purchase().
Extra call of Transaction.finish() or Clear Purchase History for sandbox user AppstoreConnect has no effect.
Topic:
App & System Services
SubTopic:
StoreKit
Tags: