I had the same issue, everything working fine locally with a local StoreKit Testing config file, but not working in TestFlight. I also thought I had to submit my IAP with with a version of the app for App Store review, and the team also gave me this answer (presumably having the same issue as my testers):
"""
When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Appleās test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.
"""
I don't think this is a meaningful answer, I think they give it to everyone whose app has IAP that fails.
I had the same issue, everything working fine locally with a local StoreKit Testing config file, but not working in TestFlight. First, you should add good error catching to your IAP management code, then, when you are running your app in TestFlight from your own device, you can plug it into your computer, go to "Devices" in Xcode, open your device's console, and start listening. Next, go through the IAP logic on your device running app via TestFlight and see what errors are thrown. I checked my logs and saw it was not finding any products, even though I had properly added the IAP to App Store Connect. Then, after way too much digging, somehow I managed to stumble on this post:
Unity IAP not working in Apple Testflight
And this is what did it! I just had to fill in my tax info and add a payment account. A couple hours after my account said Active for the paid apps agreement, the IAP flow just started working, and checking the logs again it was now returning one product as expected.
What I did not do:
No sandboxing account
No receipt validation