Xcode has been quite obnoxious recently with this issue. Start the app with the most restrictive type (.undefined), relax restrictions after looking up sandbox and app receipt.
Could be a way to enable paid features in TestFlight builds for those who originally bought them from the App Store.