Hi, @Andy
Thank you for posting in Microsoft Q&A forum.
We may try to uninstall software using WMI, here is a great example to uninstall Java by compliance setting, you may refer to it to see if it helps:
https://blog.ctglobalservices.com/powershell/mas/uninstall-java-or-other-software-with-configmgr-compliance-baselines/
(Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)
Don't check the option "Run scripts by using the logged on user credentials".
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.