Whether there exists firewall in your organization, if so, I would suggest you try to disable it temporarily to check whether this phenomenon is caused by it. You need to make sure Office 365 URLs and IP address ranges could access from your client successfully.
I also suggest you have a check whether there exists proxy setting on your client. If there is, try to remove it and connect to Exchange online again.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.