Exchange Online is denying the connection, but the permissions are correct. The reason why this may happen are shown in this article.
Exchange Online (EN)
Assign licenses with the Microsoft Graph PowerShell SDK
How to assign Office/Microsoft 365 licenses using Graph PowerShell module (Microsoft Graph PowerShell SDK)?
Exchange Online duplicate mailbox
How to resolve duplicate mailboxes in a Hybrid Exchange scenario?
It often happens that companies set up Office365 and then use it alongside the actual Exchange OnPremise infrastructure. For testing purposes or even partially productive. But when it comes to the hybrid scenario and the migration of the local mailboxes, the nasty surprise awaits. The affected user cannot be migrated because a mailbox already exists in the cloud for the same user. It is even more annoying if there is already data in the cloud mailbox. The only workaround here is usually the .pst export.
Exchange Server Mailqueue stuck and growing
Beginning 2022, Microsoft gifted all on-premises customers with something special: The mail queue of on-premises Exchange 2016 & 2019 servers stopped being processed.
Exchange Online enable send from Alias
Who doesn’t know that – you have multiple email addresses that are all delivered to one mailbox. No matter about the hosting – in your environment on an Exchange or Exchange Online. But you want to be able to send from one of these Email addresses, too. I show you how to enable that in Exchange Online.