I think this is because TestFlight disables certain sandbox flags for regulatory features. Apple might treat TestFlight builds as production like for some entitlements.
Topic:
Programming Languages
SubTopic:
Swift