We are sorry, An internal server error has occurred on redirection

Hello everyone,

I have been stuck in this issue from days.
I have stetted up the realm with custom spi configured as browser flow, to redirect user to a iam server where user will login and then identity token is being returned by the iam server, which I am saving in keylcoak users with attributes using Custom SPI, after that I am redirecting user to application.

For testing purpose I am using account-console in newly created realm. Iam is returning the call back at this URL : https://xyz/realms/realmname/account/ on which am receiving the error.
below I have attached the screenshot for error and configuration for client.

The request is not coming back to my custom spi, at the first stage its getting triggered by my custom spi

Error :

Client configuration

Network Response from browser :

I am fan of your work and support in community @dasniko, please respond