That’s because Links inside a code block or an equation are not recognized as links by Obsidian’s parser in the first place, I think. This behavior is helpful almost everywhere, but there are some exceptions like this one.
Uhm… it might actually kind of have changed, or there is a much better workaround nowadays. I reckon, but haven’t tested yet, that if you put the link in the property:
---
my_link: "[[Wikilink demo]]"
---
Then this link will be updated by Obsidian, and it can be referenced using this.my_link in the query.
That’s the problem of having a lot of “core” feature as plugin instead, leaving plugin developper the work to re-implement basic feature that work everywhere else, or worse, the possibility to cause damage trying to reimpelment things that might break in the future.
Within anything controlled by plugins, you will find custom styling, custom date formats, custom linking that might or not react the same as the rest of the product.