The problem can be observed here: https://proofwiki.org/wiki/Definition:Link_(Bourbaki_Theory)
ProofWiki currently runs on MW 1.25.
The square brackets of the ref tag are substituted with elements that are surrounded by nowiki statements. I would expect the square brackets to work as usual.
Minimal example (I think):
blablabla<ref>that was me</ref>
{{stub}}
where Template:Stub contains:
<nowiki>left-bracket</nowiki> random_stuff <nowiki>right-bracket</nowiki>
would yield left-bracket1right-bracket instead of the expected [1] as the clickable link for reference 1.
Interestingly, in the editing preview, the square brackets are correctly rendered.