It said '0x8007001f – 0x20006, The installation failed in the SAFE_OS phase with an error during REPLICATE_OC operation. I downloaded the windows 10 iso installed it (to the same version 21H1) to do a repair install, and it too gave an error and failed. DISM /Online /Cleanup-Image /Restorehealth failed at around 70% and says source files were not found' It does the same thing when I set a wim file as the source. I did the sfc scan and it said it fixed corrupted files, but nothing changed. In addition, in windows is not updating, and, it always says 'Download error '0x80070002'. Notepad didn't launch at all, and paint said something like 'unable to create file.' I tried uninstalling and installing in the optional features, but it failed to reinstall. I noticed that paint and notepad were not working.
Other post ( describes the same problem): Updates, Notepad, and DISM not working.