I copied and pasted your example. In my template editor it gives an answer of zero. In my configuration / logs there is nothing. I tried clearing the logs and re doing the code and still nothing in my logs.
This was done on my tablet. I did the same thing on my computer and the warning showed in the logs.
2021-10-09 12:52:15 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unknown' when rendering template '{{ states('sensor.eletricidade_custo_mes_shelly_em_casa_s_iva')|float + states('sensor.taxas_impostos_shelly_em_casa')|float + states('sensor.total_iva_shelly_em_casa')|float(default=0) }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2021.12
So, the bases on this are already covered. I put in a PR to change the functionality, but to keep things consistent in all of templates (every method, if statements, and filters), many more changes would need to occur. Also, this was already covered in the docs as expected functionality. 3rd bullet past the notes:
Tablet. Still think it is crazy that youâre required to make this change prior to the Dec release but the existing tool to help figure out the errors doesnât show the warning. If a template generates a warning I would think most people would want to see the warning in the editor. I believe this would make the tool much better.
My SolarEdge sensors are cloud based, and I use template sensors with them to do a few things, such as changing units of the cloud sensors from Wh to kWh, etc. After upgrading to 2021.10, I started getting warnings for these template sensors regarding unavailable while using float. Sure enough I found that the cloud based sensors were going unavailable several times a day, but my template energy sensors were going to 0 during this time (presumably because float default was 0).
As there is now a is_number() filter in 2021.10, I am now using is_number now to qualify my template sensors and do the conversions (say Wh to kWh) only if the cloud sensor has a numeric state. So if the cloud based sensors go unavailable (or anything else non-numeric), so will my template sensors.
I agree with petro that this is probably the exact use-case that spurred the development team to tighten-up how default values are handled.
Anomalous values were being masked by silently rendering them as 0. Now that you have discovered this was happening in your template, youâve taken measures to mitigate it and thereby making your template more error-resistant (and producing more consistent results). Good work!