Everything within the opening and closing double braces is understood to be Jinja2 code to be evaluated by the Jinja2 processor.
By embedding one template inside of another, the “inner template” isn’t a template but a literal string that the Jinja2 processor attempts to evaluate (and it cannot make sense of it).
EDIT
According to the automation you posted here, the nested template was used in notify.residents action for title and subtitle. In other words, the error wasn’t even due to the event action for TheFes’s Trigger-based Template Sensor.
Was it the automation’s trace that led you to believe the event action was at fault?