As the Shelly device does not store historical data it’s impossible to say if it was caused by a bug in the Shelly firmware or the Home Assistant integration.
The dashboard itself is reporting correctly. If it sees some_value
→ 0
→ some_value
it will add the 0
→ some_value
step. This will not occur if the device reports some_value
→ unknown
→ some_value
My SMA solar inverter energy has done a similar thing in the past so I filter out all 0 states (and low values) and feed that to the energy dashboard.
You should add the correct device_class and state_class if using the filtered sensor directly with the energy dashboard (the utility meter adds these for me).