In-app purchase fails at first attempt, succeeds at second

Our macOS app has one in-app purchase (IAP) implemented using StoreKit 1. It works for us and beta testers but App Review get SKErrorDomain Error Code 0 / ASDErrorDomain Code 500 / AMSErrorDomain 305 on first attempt to make the in-app purchase.

However, the purchase succeeds at second attempt. We've looked through our entire IAP related code and App Store Connect setup but can’t find the reason. It's a standard implementation:

  1. LegacyPaymentQueueObserver for SKPaymentQueue observation.
  2. AppDelegate for initiation of payment queue observation on app launch
  3. LegacyStoreKitPurchasableProduct for initiating a purchase and listening for the result
  4. LegacyStoreKitProductsRequester for how we load the product before user can make in-app purchase. It happens this way:

PreviewResultsViewModelcalls loadProducts()on an instance of StoreKitPurchaseManager, which asks an instance of LegacyStoreKitProductsRequesterto requestProducts(forIdentifiers:)

Any guidance to resolve this would be appreciated.

In-app purchase fails at first attempt, succeeds at second
 
 
Q