Wrong template screws up loading

Hi all,
I’m pretty new to this world so sorry for noob question, I just want to understand why I’m having strange situation with my configuration.
I’m trying to set up a template to monitor outside temperature in my config.yaml in this way:

  - platform: template
        friendly_name: "Outside Temp"
        unit_of_measurement: '°C'
        value_template: "{{ state_attr('weather.home', 'temperature') }}"

but if I restart the home assistant with this piece of code in config, even if the “check config” gives OK, I’m no more able to log in into my home assistant (homeassistant.local:8123).
Does anyone know what’s wrong with this template?

more in general, is there a way to prevent this behaviour? every time I restart home assistant is a pain in the ass and I have always to cross my fingers that everything went ok with the loading…

Thanks for help

Nothing, should work like it is.
Maybe show us the complete sensor: part of your config.

Assuming of course there is an entity called weather.home with a top level attribute named temperature.

Go into Configuration, Servers Control and then Check Configuration. It’s a good habit to know if the code will work before a reboot.