@Sam Conroy, Thanks for posing in Q&A. From your description, it seems you want to stay on Windows 10, have we tried to configure Feature Update policy to let it stay at Windows 10, version 22H2 version.
https://learn.microsoft.com/en-us/mem/intune/protect/windows-10-feature-updates
Meanwhile, for script testing manually on the device, to test it under system account, we need to use PsExec tool to let it run under system account because environment variable is different when run under different account. Please confirm if we use PsExec.
https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
After reviewing the detection script, I find the format is not correct. You don't have exit code included. Based as I know, exit code exit 1, meaning the issue was detected. Here are links with script example you can refer.
https://learn.microsoft.com/en-us/mem/intune/fundamentals/powershell-scripts-remediation#script-descriptions
https://www.velessoftware.com/deploy-a-remediation-script-using-intune/
Note: Non-Microsoft link, just for the reference.
Hope the above information can help.
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.