I had the same issues with templates. Now I test everything in the template tester in the dev states panel for a quicker back and forth on what may be missing or incorrect.
But it’s always easy to reverse the single and double quotes in YAML until you get used to it. I’ll bet you don’t do it again!
I’m still new to HASS and can’t really get my head around the rules on single and double quotes, many of the examples seem to use them interchangeably. Is there a ruleset?
I was going to say its weird some of your lines use single outside quotes for the line while others use double. But as you can tell either work fine, if you use single on the outsides then everything inside will have to use double quotes, and vise versa, I suggest sticking to one style though.
I don’t know about actual rulesets, but personally when it comes to template sensors I always use double quotes outside. I feel like if you use double quotes outside, then you always use singles inside.