I must confess I haven’t read everything in this thread but the discussion just rang a bell here: the UniFi network binding is suffering the same problem where connections are refused after two hours. A while ago I dug a while to find out that this was caused by an old jetty version in the dependency tree that does not support partitioned cookies. So this could be same problem here. There is also a lengthy thread about this on GitHub, however the problem was up to now that jetty is an upstream dependency of karaf and there were delays in the release cycle there. I have no idea if we are still in this situation, I have a workaround in place in my installation for now. I’ll search for the discussions and share the links here.
Please have a look here: Unifi and 2FA - #19 by DrRSatzteil
And some more here: UniFi binding beta [3.2.0;3.6.0) - #175 by DrRSatzteil
A new Jetty is still not in sight: Upgrade to Jetty 12.x · Issue #3315 · openhab/openhab-core · GitHub