I believe you are referring to an older demo on my site, not the one in the link above. I have found that this does not work correctly, which arose sometime afterwards (was working), due to this issue (which shows a fix):
https://www.metricrat.co.uk/google-apps-script/return-output-from-function-call-in-doget
(I will update the older topic to reflect this)