This has been pretty strange and I'm pretty sure it has to do with the zillions of settings in the Unifi controller. I've been pretty aggressive about hitting every box for our home network, but here are some learnings from reading troubleshooting tips from Unifi:

The symptoms:

1. Devices will refuse to connect to our network even when they worked a second ago. Sometimes even if you manually type the password, they will not connect. Then mysteriously they will again.
2. Devices keep losing passwords even though they are
3. AppleTVs keep disappearing. Even if one is active and running, it doesn't appear in the Apple Remote application of the phone.
4. One Windows machine kept falling over to 2.4GHz even though it is very close to an AP.

Some theories:

1. I had checked a bunch of enable advanced features like Band steering (so you favor 5GHz), optimize for high performance devices and Airtime fairness as well as AI to move APs to cleaner bands. I'm wondering whether this causes it. It could also be that there is a minimum RSSI (that is signal strength), so you might want to turn that down.
2. There is a bunch of mumble about broadcast messages and interference with Bonjour, this is used by the Apple TVs.
3. There was a setting for using a VPN, so interesting to ask if the network was somehow separate between Wifi and wired clients.
4. The power is turned on too high. They are set to Auto right now, but there is a theory that you need to manually turn them down to low. I really don't want to do that though as it's nice to have them radiating into the yard.
5. You can also check this by making the 2.4GHz and 5GHZ networks separate. Personally I don't like to do that as it's way too convenient for users not to worry about this.
6. The new Unifi software has mesh routing turned on by default. I don't think it affects anything and all my APS are wired, so I shut this off just to see.
7. Finally for that lonely Windows machine, it turns out that there is a setting Windows 10 for the driver that says prefer 5GHZ buried way deep so I turned that on.
8. There is some words about fast roaming and the need for clients to support 802.11r and 802.11v. That wasn't it as iPhone 4 and later all work with that.
9. Then we have an LG television that is wireless and it is very intermittent.

So here is what the investigation found:

1. Apple TVs. They do have to be powered up to be in the network. That explains the few that are off, but there is definitely one on that is not seen. This is confusing, since it does see two other Apple TVs. One wired and other wireless.
2. Since turning off advanced features, we have not had disconnects, but we need to see how that goes.

Then there are some things learned that should make things better

1. DTIM = 3. This is probably the most interesting setting. The default is that every second your phone has to wake up and talk with the Wifi network. Setting it to 3 seconds reduces the power drain apparently.