Using ID Provider and User Federation in one realm

Hi all. Was wondering if anyone can help me with an issue I’m having as I’m not finding any documentation on my specific situation.

The goal is to have one keycloak realm where users can manage their LDAP and Azure AD user passwords. Now currently it’s working having our LDAP server configured under User Federation, to one realm (realm1) and the Azure AD configured as an Identity provider on another realm (realm2). This means our users have two urls where they can log onto and manage their user passwords however we want only 1 url if that is possible.

Now I’ve testing adding the Azure AD to realm 1 but the moment I try and log into the Azure AD side (by clicking on the newly added button when adding an identity provider) I get this error.

Screenshot from 2023-02-27 13-30-42
If the image does not appear. Error states “We are sorry… Unexpected error when handling authentication request to identity provider.”

I’m unsure what is causing this issue and can’t find anything online related to my situation.
Note: There shouldn’t be any username conflicts as the usernames form our LDAP server differ from the users on our Azure AD.

Any help is appreciated!