Once a system is infected, there's no 100% guarantee that you're removing all parts of the ransomware or other malware that was installed on there. It sounds like you still have some malware installed that is causing you problems with Windows Update and it's services.
I'd recommend a wipe and reload from a CLEAN USB media for Windows 10/11 (made with a known good clean computer) depending on what OS you had on there.