It sounds like you have used a (MSA) Microsoft Account (rather then the Office365) account to create the application registration, because the publisher isn't verified you won't be able to use it in your Office365 tenant https://learn.microsoft.com/en-us/azure/active-directory/develop/publisher-verification-overview. What you need to do is logon with the Office365 account and create your Application registration in the Tenant itself and consent to it there.
Generally if you have ADFS and your try to use ROPC (resource owner password credential)https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc then MSAL will try to do and Active ADFS authentication which basically is a SOAP authentication request with the username and password against to your OnPrem ADFS server (vs a Passive auth which is a forms based authentication against ADFS). To make things easier from an Auth perspective have you considered using ClientCredentials flow https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow. This will simplify your authentication greatly and should make it more secure as you nolonger have a username and password, if your concerned about the app having access to mailboxes it shouldn't you can scope the access using application policies https://techcommunity.microsoft.com/t5/exchange-team-blog/application-access-policy-support-in-ews/ba-p/2110361#:~:text=Background,on%20behalf%20of%20a%20user.&text=Using%20an%20application%20access%20policy,an%20inclusion%20or%20exclusion%20list.