Partner-facing codes from /session, /session/{id} and /revoke when isSuccess is false. Read errorCode (and HTTP status ≈ statusCode). A failure envelope has no result field at all - not null, not false:
So branch on isSuccess and errorCode, never on whether result looks empty: POST /revoke returns a boolean result, and a successful "result": false is a real answer rather than an error. See Response envelope if you map the envelope into a typed class.

invalid_return_url - the exact-match rule

The registered URLs are compared to your returnUrl as whole strings, case-sensitively. It is not a prefix match and not a host match, so every one of these fails: The failure happens on POST /session, before the user goes anywhere - so it appears in your server logs, never in front of the user.

Hosted verify page (400)

The verify endpoint is opened by POSTing the handoff token to it:

HTTP 401 with empty body

Basic header missing or not parseable. Send:

Landing page and result

Nothing is delivered to your server, so every failure here is a read that did not happen or a check that did not pass.

Frontend