Had this error on an HP laptop that was trying to update to the Fall Creators Update, found a simple solution that worked for me here:
https://www.drivereasy.com/knowledge/windows-could-not-complete-the-installation-solved/
Basically you enter the recovery console, go to Reset My PC, Keep My Files, and at the last screen you CANCEL, then Exit and continue to Windows 10.
May or may not work for you, but worth a shot if anyone is still having this issue. Prob wouldn't recommend you install Drivereasy, personally I hate those 'driver update' programs, but that's up to you. ;-)
Time will tell if it happens again. Will clean up Windows in the meantime: install all HP updates, remove any software that isn't needed (like an expired McAfee that was bundled) etc..