Because when your energy sensor disconnects or becomes unavailable it reports 0 instead of unavailable. Then when it reconnects there’s a massive jump from 0 to whatever your energy running total is.
You can filter the sensor. Here’s how I did it for my SMA Inverter: