I've had similar issues with clients (Blink camera sync modules) connecting to far-away APs instead of the much closer router. I could not force them to connect directly to the router no matter what.
Turns out the 2.4 GHz radio of my router had died (Fritzbox 7590, apparently a common issue), thus forcing 2.4 GHz-only clients to use those other APs.
And actually debugging this unless you have a bunch of enterprise level kit, or know exactly what the failure you’re looking for is is absolutely impossible
In ubiquity gear you can “lock” devices to a specific endpoint. I suspect ultimately you would prefer to have failover available but at least for troubleshooting you can see how it connects to that specific AP. Similarly you could see the amount of clients connected to an AP on every frequency and WiFi version.