In certain situations, Sysprep may fail when antivirus is enabled and running.
There are several ways to disable Microsoft Antivirus. This article outlines a method aligned with best practices.
To disable Windows Antivirus, go to:
Start > Settings > Update & Security > Windows Security > Virus & threat protection > Manage settings
Refer to the image below:

Using Windows Security will temporarily disable Real-time Protection. This feature is automatically re-enabled after a system reboot.
Uninstalling OS packages or provisioned apps in Windows may prevent access to the Virus & threat protection settings page (see step 3 in the image above).
This may trigger a pop-up prompting you to select an app from the Microsoft Store.

This is a known Windows issue. For more details, see:
Microsoft Support Article: Sysprep fails after removing or updating Windows Store apps
Quest KACE recommends avoiding upgraded Windows images. Instead, create a new virtual machine and install the desired Windows build to capture a clean image.
Another issue that may occur after removing OS packages or provisioned apps is a missing or incomplete Security Settings menu.

If removing provisioned apps before Sysprep is required, proceed with caution, as some apps are critical to the operating system.
Additional resources: