I had the same Issue with a Microsoft 365 Mail Account.
A customer sent me a message that an attempt to reset their password threw an error at the user.
The Button "Test Connection" (in Keycloak > Realm Settings > Email) returned the same unintelligible error.
I think this was due to the mail account being blocked after multiple login attempts from a malicious source.