From further work, I now believe that I was incorrect in my diagnosis...
The reproducible issue was that one of the layouts I was calling later in the script was not Classic theme.
My bad. Sorry!
Another possible gotcha is that some script steps which work fine in Pro and Go are not web compatible. Be sure to check your script with the step compatibility set to show the web steps if you encounter any scripts not working as expected on the web.