You can test paywalls on the device, whether it is from TestFlight or compiled from XCode.
You can use the iOS simulator to display your paywalls, and you can simulate payments using the StoreKit configuration file (https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode) because the App Store is not available on a simulator, you cannot test payments on it.
What is the difference between simulated payments and test payments?
Simulating payments means your app will trigger payment flow but cannot be completed at the end. Your app will try to buy products that are defined in a local file and not in the App Store.
Testing payments on the device means your app will perform the complete payment flow just like in a production environment but you are not going to be charged for the product you are buying.