I had a similar problem. I was not getting sandbox server notifications when running through the simulator. But when I tried through TestFlight, everything worked.
This has a table that says that JWS receipts are not provided through XCode testing - https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_at_all_stages_of_development_with_xcode_and_sandbox