Disable Modern Authentication by regedit HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity
Create a DWORD value named EnableADAL and set it to 0.
If this does not work under the same registry key, create a DWORD value named DisableADALatopWAMOverride and set it to 1.
If these don’t work, you can try the recommendation from https://www.ramblingtechie.co.uk/ below.
There are a lot of articles around on fixing this with different registry keys, but a lot of them didn’t work for me. The fix I found that worked is to create/modify the following DWORD entries as below: