I am not really familiar with the use case you are using but just looking at the actionscript the first thing I would try is to add the line to disable the x32 redirection - by default all scripts would run in x32 mode and a lot of the PS commandlets and in fact batch commands work when ran as x64 but do not as x32. Hard to tell whether that is what you are facing since the ps1 files are not available but it certainly does not hurt to rule it out, especially since you use relevance sustitutions with “native registry” which would point to x64 branch of registry; x64 bin file; etc). Stick the following line on top of the actionscript and see what you get when you execute it:
// This would disable the redirection on all x64 OS and for any x32 OS (if you have any left in fact) it will run as default x32
action uses wow64 redirection {not x64 of operating system}