Well since you had to write your own software; does that mean you believe that following the Microsoft recommendations isn't really sufficient to keep WSUS working well?
I've been running WSUS since server 2008 and have never had any issues until Server 2019. I still run Server 2016 at home, on a small home-built server and I service 3 different versions of Windows with it, and have no issues, even with drivers.
Yet here at work, we run Server 2019 on a Server with 32 cores, all NVMe storage, 64gb RAM, only service Win1021H1 x64 and can't do server cleanup unless only check one box at a time, but can't run Unused Updates and Revisions or it will crash the console. And, can't do anything with Drivers, except as mentioned above.
This issue has existed since Server 2019. I've stood tried Multiple times with multiple machines, Installed Server 2019 at least five different times, even Downloaded Fresh copies of the ISO three times, just to make sure I wasn't introducing something from the DVD, all with the same terrible results.
Yet when we ran Server 2016 in the same environment , we had no issues.
I even went so far as to install 2016, configure WSUS and let it run for a month, then performed all main I/A/W MS How to configure WSUS and best practices (Pre 2022 versions) and received the same result.
So........... IMHO, it's broke.
Next I will try the evaluation version of Server 2022 and see if that works....Unfortunately I have no other option since we run on a DOD Classified Network. I've found it almost as easy to manually download the .cab from ms and push them out with a script, then query the systems to ensure they installed.