Maybe do some logging in your script to compare the machines that work vs the one's that don't.
Things that come to mind to check: @userid, @kix, @producttype, the reghack value