https://learn.microsoft.com/en-us/windows/release-health/status-windows-11-23h2#3351msgdesc
KB5039302 Opened: 2024-07-12
After installing the June 2024 Windows preview update, released June 25, 2024 (KB5039302) and later updates, you might face issues using Windows Update Agent API (WUA) from your script (PowerShell, VBScript, etc.) while searching for Windows updates. Due to this issue, you might get an empty result when querying the properties of IUpdate objects present in the IUpdateCollection and error code 0x8002802B (TYPE_E_ELEMENTNOTFOUND) when calling methods on the object from your script.
Organizations using Windows Automatic Updates are not impacted by this issue. Home users of Windows using Home or Pro editions are unlikely to face this issue as their devices are managed using Windows Automatic Updates that doesn’t run into this issue.
This issue is resolved using Known Issue Rollback (KIR)..