I have had this problem again today, and disconnecting/reconnecting WiFi did not work this time. I searched the internet again and found
https://www.stephenhackers.co.uk/outlook-credentials-flashing-and-closing-constantly/
which says that you should log out from Office using an application other than Outlook (e.g. Word):
(Picture taken from the linked website).
I did not use Word, but logged out from Outlook, closed it, reopened it, logged in, and the flickering was gone.