I have narrowed it down to the specific error:
Setting a specific ticket number works:
<queryDef label="Copy_Mail_Submitter" sql="SELECT staff_email FROM ksubscribers.kasadmin.vbo_SDIncidents_General WHERE ref='SMN000651'" />
Using a Kaseya variable will not work:
<queryDef label="Copy_Mail_Submitter" sql="SELECT staff_email FROM ksubscribers.kasadmin.vbo_SDIncidents_General WHERE ref='[$TicketId$]'" />