You must resolve the issue that's causing the Windows Defender uninstall failure.
A common issue that prevents the removal of Windows Defender is a corrupted Microsoft product catalog. To fix a corrupted product catalog, perform the steps below:
- Uninstall the Windows Hotfix or Update that corrupts the product catalog.
- Run a scan and check whether there's any corruption. Use the following command:
sfc /scannow
- Reinstall the product catalog using Windows installers. Use the following command:
DISM.exe /Online /Cleanup-image /Restorehealth