To fix this 0x80070002 error, please follow the following steps.
Step 1: Fix Windows update by using its update troubleshooter?
Step 2: Fix Windows Update issue manually.
Step 3: After that, Update your Windows properly. It takes some restarts. So please allow reboot.
Step 4: Make a Windows 10 bootable USB drive.
Step 5: Then Upgrade Windows 10 using its bootable USB. Make sure your Internet is working properly without applying any proxy settings.