Universal Control is amazing, fluid, seamless, natural, intuitive, and productive till it is not. And, that is the problem. It just works effortlessly, perfectly then it stops at the most inopportune time leaving you scrambling to grab other keyboards and devices.
I've two iMacs and an iPad and when it is working my workflow is amazing. I can run build operations and tasks on one iMac slide files back and forth and work in other tools and apps on the other iMac, then test applications I'm developing on the iPad that have just been built or updated, all from one keyboard and trackpad. And then it stops working. "Bumping" the edge of the screen a few times can restore it, sometimes, but often it just leaves you frustratingly tapping the edge trying over and over and failing. I've tried killing UniversalControl process, reconnecting, turning bluetooth on and off, same for WiFi and LAN and even rebooting all devices, and when it has decided to stop working none of those efforts and tactics nor any of the tips that others have provided work. It simply "decides" not to work for a while and then inexplicably begins working again. It also frustratingly senses the wrong layout or location of devices.
I think Apple is trying to make it too seamless and automatic by NOT providing a configurable layout and permanently defined connectivity between devices. They're cleverly trying to make it completely automated and in doing so, whatever wireless dependencies and signal analytics they use for estimating the layout and connections is failing from perhaps interference or intermittent outages. They should provide both, a way to sense and automatically enable it, and a way to lock down the configuration and layout so that when signals are intermittent it will most quickly heal the connectivity and resume operation. Even more, if they provided such user configurable settings then features like Thunderbolt connectivity between iMacs or other devices could use the full bandwidth (40Gbps) throughput and keyboard+mouse+trackpad+file transfer would operate perfectly with no lag or disconnect.
If anyone knows how to get into the guts of this feature to hack a static configuration, it would be perfect. Till then, we're all left with a wonderful feature that works only sometimes. Which is like having a car that MIGHT get you from point A to point B, but sometimes stops running half way to your destination. So, you do your best to never become completely dependent on it.
And all of that brings to mind, are there any similar 3rd party solutions? I've another machine that is dedicated to CI/CD and not part of Universal Control, which I remote into, that connection and interface remains live 24 hours a day every day and never disconnects or fails. If remote client vendors can do it, surely Apple can, but this thing has been buggy for months now and I'd be willing to buy a stable reliable solution.
Edit: I'm here now because it is failing, yet again. I've found no reliable way to restore it. This time I was able to get it to restore functionality by copying a file to clipboard. You may notice similar success. When you select a file on one device and select "Copy" your other device (iMac) will show a dialog that the file is being copied even if you don't actually move your cursor or focus from one Mac to the other. When that happens you can check the display layout and find all devices shown, but likely in odd positions. Choose "Arrange" and correct the positions, and the service begins working correctly again, for a while. Again, this does not always work, but it does sometimes when all other techniques have failed.