I am in the same boat. I am wondering if anyone has ever successfully used AppTransaction in production. The code in my app is the same, in essentials, to the example in the docs, and it works perfectly in the Sandbox. It does not work in production, and has caused Review to reject my app. I'm at a bit of a loss as to where to go from here.
Extensive testing has led me to suspect that AppTransaction.shared and AppTransaction.refresh() never do anything with Production, and only ever check the App Store Sandbox for receipts.
Here's a link to someone else with the same issue. Scrolling own to the answers section, you'll see that they, too, suspect AppTransaction just simply doesn't work in production. https://stackoverflow.com/questions/75700010/macos-storekit2-using-apptransaction-shared-triggers-user-login