Maybe this should not be called a bug, it’s just that the script in that post is not compatible with version 2.1. If you want to use it, you just need to modify it to work.
Anki desktop(ver2.1) updates only part of the document, not the entire document.body, when displaying a card, and probably because of this, updating the entire document with innerHTML property may not work as expected. There are some possible solutions to this, but a relatively easy one is to limit the part you get and replace with innerHTML property to the inside of the range that is updated when each card is displayed.
Here is an example of a template that also works on Anki Desktop 2.1:
var regex = /\[\[(.*?)\]\]/gi;
var repl = `<span class="cloze">$1</span>`;
var container = document.querySelector('#my-script').parentElement;
container.innerHTML = container.innerHTML.replace(regex, repl);