This is an example of how <ref> tags don't work[1] inside templates.
Here's a Thingy[2] with its <ref> tag within a template..
This reference[3] works, but the one in the template (above) doesn't.
Some words from Brion on the topic: