All credits go to MonarchX for this fix.
The necessary files are here:
Follow these instructions exactly. I installed a clean untouched 16179 rs3 (Pro x64) on a separate partition. I did absolutely nothing to it except sign in with my MS account. I ran dism /online /cleanup-image /restorehealth and it FAILED. I followed the instructions EXACTLY below, and it worked.
1) Download the zip file from above link, and extract. I put the files on my root drive. There is NSudo 4.0, and CBSEnum_x64.exe (and x32.)
2) Run Nsudo as admin, CLICK ENABLE ALL PRIVILEGES BOX, select TRUSTED INSTALLER, and open CBSEnum_x64.exe with Nsudo.
3) In CBSEnum window select Edit -> Take Registry Ownership. When this has finished you can close the Window (not CBSEnum. One other time this 2nd window pops up, and it can be closed.)
4) Select Flat List on the right pane of CBSEnum under Group.
5) In the window navigate to Microsoft-Windows-TestRoot-and-FlightSigning package entries. There will be TWO of them.
6) Select both by using the Control key.
7) Right-click and select Visibility -> Make Visible.
8 ) Right-click and select Manage -> Decouple.
9) Right-click and select Uninstall All. You will need to confirm you actually want to do this. You do.
11) Open the Registry Editor, and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\
12) Remove the TWO entries in CatalogsToUninstall.
14) Again run dism /online /cleanup-image /restorehealth and watch it complete successfully.