Thanks for the post and for your patience on this. I’m not a PKAddPaymentPassRequest expert, going to try to give you some pointers and see why are you getting that error 500. I would recommend to provide the sysdiagnose to your bug as well to get the team see the errors on the device.
I believe if you are passing an empty PKAddPaymentPassRequest() will immediately fail the provisioning process. However, if you are passing populated data and still getting a 500 error, it means servers attempted to use the public key to decrypt the encryptedPassData and failed. This almost always points to an issue where your backend/payment network did not encrypt the data using the exact certificateChain that was generated on the device?
I would recommend to print the values you are passing with base64Encoded. I personally use the Data class and then add a print statement to make sure the data is correct, you can check manually if the data is been encoded using a third party tool.
Data(base64Encoded: payload.activationDataText),
From the documentation you do not create this request in isolation; it must be created inside the PKAddPaymentPassViewControllerDelegate method called generateRequestWithCertificateChain. Apple Wallet generates a certificateChain on the device. The system passes these to your app via the delegate method, your app uses this payload to create the PKAddPaymentPassRequest and passes it back to Apple via the completionHandler.
https://developer.apple.com/documentation/passkit/pkaddpaymentpassrequest
https://developer.apple.com/documentation/passkit/pkaddpaymentpassviewcontrollerdelegate
Hope this helps, I'll keep an eye out for the sysdiagnose on your bug to be routed to the correct team.
Albert WWDR