I miss the good old days you could repair Registry by loading an older instance. It was done in Windows 98 by running the scanreg command with the appropriate parameters. From Windows Me and later you can use System Restore to go back to an earlier restore point, provided you have enabled System Restore (it is disabled by default in Windows 10 and 11) and there is a suitable point to return to. Once you fix it with an in-place upgrade or with a clean installation, make sure you enable System Restore and you create a restore point. If anything goes wrong again just return back to this point. Your data are not affected.