Every now and then, my Macbook Pro running the latest macOS won't connect to my WiFi. It just keeps insisting:
The Wi-Fi network "Ubiquiti UniFi" can not be joined.
This happens both at home, and work, and on other random locations. It's only occasionally, it connects just fine most of the time. But when the problem shows up, no matter how often I retry to connect, the error keeps showing up. And then later that day (like a couple of hours later) it randomly connects by itself as if nothing is wrong.
Something I noticed: normally when connecting to a WiFi, the connection thingy in the top menu bar in macOS shows an animation with the bars in the WiFi icon lighting up one after another, like this:
Now whenever this connection problem occurs, I noticed the bars do not light up. The animation doesn't happen, the entire icon just stays dim. It feels like it's not even trying to connect, but obviously that's just my interpretation from not seeing the icon animate.
Also whenever this happens and I try to connect with my phone (Android 7) or iPad (iOS 10) instead, it works fine all the time. So the WiFi access point itself is really working absolutely fine.
Also my signal isn't blocked or weak or anything, I'm literally sitting 2 meters away from the WiFi antenna, with no obstacles in between. And there's not a ton of other WiFi stations nearby that might be disturbing my channel (sometimes I see two or three other SSIDs in the list with weak signals, sometimes I see none).
And there's not a ton of devices connected to the same network either. Usually just my laptop, sometimes also my phone or iPad, maybe a phone or laptop from my wife at home or colleague at work, but that's about it.
I have even tried resetting my Mac's NVRAM and the SMC, unfortunately to no avail.
Any suggestions what the hell could be causing this, or what I could do about this?