SSO entra Logout error

I set up a self hosted system. I was able to setup SSO for Entra ID (Azure). I can login succesfully, however when I sign off. I get the following error.

AADSTS7500530: SAML NameId cannot be null.

I did notice when I sign in I get this error but I can still login. I am not sure if this is related
error: ScopedSession[g-bda5f8ceaf2e8c4c93b8112ff75cda1db48318befc4dc58841cf6503fdd476e5]: Error updating sessionStore: Error: failed to load session

I did try to change the NameID to surname in Entra.

roubleshooting

We expect IdP to provide us with name_id, a unique identifier for the user. We also use optional attributes for the user’s name, for which we accept any of:

You may need to tweak your IdP’s defaults to match Grist’s expectations.