I have not worked with this exact error before, but I remember from working with similar errors that the ones starting with “Error from apple connection” are an error we receive when we attempt to exchange the authorization code with Apple.
I don’t know if you’ve seen this Apple Developer Forums thread yet:
It has a few ideas–some of them involve the process of actually exchanging the authorization code and those don’t apply to you because we’re doing that for you. There was one comment from an Apple employee that looks promising:
The client_id used when calling the token endpoint should match the native app’s app id. The services ID should not be used here and using that would result in failure due to mismatch between the client_id for which the authorization was granted and the one that is presenting the code for validation.
“client_id” there maps to the “Client ID” field in the SIWA connection setup. It’s not very clear from our docs or the Apple docs that Services IDs and App IDs are for web and native apps, respectively.
If you DM me your tenant name and a rough timeframe when you you received one of these errors, I will see if I can find out anything else.