In a nutshell: you've gotten Universal Control to work across two (Mac) computers. But Universal Control stops working frequently. It also seems like UC is not automatically reconnecting, right?
I had a similar problem between a Mac and an iPad. Be sure to check that (on *both* Macs) in
Preferences -> Displays -> Universal Control
.. all *three* items are checked. Definitely including:
"Automatically reconnect to any nearby Mac or iPad"
Whenever either Mac's screen locks and shows its screen saver and/or goes to sleep, the link used by Universal Control to connect up the keyboard & mouse will disconnect. With "Automatically reconnect ..." the link should reconnect without your having to do anything (besides waking up both Macs up again).
... As long as the systems aren't blocked from signaling each other that they're awake...
For me, a system Firewall was what was preventingthat. Check the firewall status on both systems in Preferences -> Security & Privacy. If either runs a firewall is (i.e., "Firewall: On), go into Firewall Advanced Settings -> Firewall Options and make sure incoming connections are allowed, at least for these two processes:
rapportd
Universal Control.app