I think I have finally isolated a fix. org-info.js uses the magic number "4" (i.e. the length of the string "sec-") to substring DOM ids in order to fin section numbers (this is on line number 97 in the source code of org-info-src.js). However the changes to org-export-get-reference mean that instead of using the string "sec-" before the section heading, ox-html now used the string "orgheadline". Thus, the fix is to replace "4" by "orgheadline".length in the source code of org-info-src.js.
This seems to be the simplest way to fix this error. However, as it is, it will break those people's code who are using the online version of the script. We will probably need to detect what string the html file is using in the DOM id for headlines and used the length of that string. I will try to write a patch in the next few days if this strategy sounds good.