Sorry for writing in English.
I have a Mac (running Sierra) and I had a similar problem. iPhone and tablet would connect fine, but my Macbook sometimes wouldn’t connect to wifi. Usually, rebooting the laptop would fix it until the next time. It was random. For me, it turned out to be a problem with “Country Code”.
Someone had a router in my apartment building broadcasting “CN” (China) as country code which my Macbook would occasionally lock on to (it should pick the strongest wifi signal and the Connect Box doesn’t seem to send its own Country Code so it would pick one of my neighbour’s). China doesn’t allow many 5G channels (such as 112 which my Connect Box loves to use).
Solution is to change the Connect Box settings and set the Channel to manual and pick 44 or 40. Try that.
My problem has been fixed now that whoever had that badly configured router has either moved out or reconfigured it. I’ve now changed the Connect Box back to automatically pick the channel. It usually picks 112 and that’s always working now.
When you can’t connect to your wifi, option-click the wifi icon in your menu and see what the country code is set to. I’ve attached what it shows right now - the country code is nicely set to CH (Switzerland).
