I have a home Windows 11 computer and had the same issue happened suddenly with Office 365 products even though I could browse the web and even Teams worked fine.
I spent hours trying all the suggestions in this post and others and none worked as most assume the internet connection is not working at all.
I use a PIN to log in so at a whim I tried signing out and then signing in saying I forgot my PIN and using my authenticator (but not resetting PIN) and voila, no errors anymore.
I had to use this method for a few days until all 365 products worked fine when I could sign in with a PIN again.
A very frustrating issue that appears to a Microsoft authentication/configuration issue.
As an update discovered my wife's laptop had the same issue, she didn't really understand the error messages so carried on not realising emails were not downloading and files were not being saved to OneDrive.