You should have quotes around the event type like you had originally, but the indenting needed to be fixed like finity said.
This looks like the Aqara tilt sensor; I have config you can reference here.
Edit: I stand corrected. It looks like it doesn’t matter whether or not you use quotes around the event_type. Which leaves me wondering why your template isn’t working. What else does the log say? And are you certain you aren’t using that unique_id (garage_door_tilt) elsewhere in your config? The error you mentioned means that the trigger variable isn’t populated with data, which doesn’t seem possible if the only trigger for this template is what you’ve shown.