It would help if you provided more information:
- What is shown if you click "Show details?"
- What version of calibre are you running?
- On what operating system?
- What are #aa and #bb?
- Your copy of the template is missing a closing ')'. Is that a copy/paste error?
Question: that lookup call says to use the contents of #aa if there is a series, otherwise use the contents of #bb. Is that what you meant?