Actually, the fact that it works in a calibre template is probably a bug.

Calibre removes slashes in template items, with the exception of a leading slash in a tag. The probable bug is that composite columns (columns built from other columns) don't have that processing (slash removal) applied to them. There isn't a good reason why composites should be treated differently from custom text or standard columns. However, I am not going to fix that probable bug because it has been there too long and people (like you) might depend upon it.
[CC stuff snipped out]