Mail servers work at the whim of their providers. Some providers work really hard to keep them going 24/7/365; Others have a much lazier attitude about it. Some providers feel free to take servers off line to do backups, for software upgrades, or have failures and don't rush to fix them.
Because of the complex ways these Mail Servers are set up, it is quite likely you can get mail with one or the other of MacOS Mail and WebMail while the other one refuses to respond.
MacOS Mail knows only ONE error -- the server did not respond. And it knows only ONE solution -- to ask for the password again.
If you just tried to set up Mail for the first time, that response makes some sense. Otherwise it is garbage. If you enter anything, other than just dismiss the box and try later, it is more likely to mess up your settings.