I solved the issue I had. Turns out I didn't set the StoreKit config in my scheme.
Go to "Edit Scheme" -> "Run" and check if the config is set. If not, follow this guide:
https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode/
It should look something like this if the scheme is set up correctly:
Topic:
App & System Services
SubTopic:
StoreKit
Tags: