I am late to this discussion, but might be running into the same issue. I find that if I have purchased a subscription already in a testing environment, I receive a success message without getting the purchase sheet first. If you're still encountering it, I believe this was being executed with the previous transaction:
https://developer.apple.com/documentation/swiftui/view/oninapppurchasecompletion(perform:)
I need to keep digging into it to learn more, and will post an update here if I discover the cause. Note that I have found the transaction manager helpful for testing scenarios: