Hello there,
The error message tends to suggest you can;t connect to EOL. That could be because of a bad password.
One trick that sometimes works - use the -Verbose switch - it can give you more details as to what went wrong.
Any chance a corporate security product is blocking it, say something like zscaler for traffic filtering on the network level, or local AV product?
The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.
https://learn.microsoft.com/en-us/answers/questions/912371/exchange-online-ps-error
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--