Somehow it is working now. I swear I haven’t done anything since I posted. I just set up a new wordpress site (earlier version) on another computer and verified that the code was working. Then I came back to the original site in question and refresh, then it just somehow works.
Sorry for the false alarm.