In the Script function, it can uncheck any policy and the script can run normally. But if you call this script in a scheduler, you must correctly select the policy in the Script and the Scheduler.
So the question is, why not prompt permission denied when click the "Run Script" button?