Energy data corrupt due to wrong data in "statistics" table?

I have been running the Energy dashboard for a few days. Everything was fine, until recently the graphics were corrupt.

I had a look in the tables and I found this strange data in statistics table. Some range of the values for “sum” are negative for my total_yield of my PV entity, but only a few Not all of them…

Any idea what could be the reason ? Can I recalculate these values so that it’s correct again ?

I had something similar

I think the statistics need some smarter logic for lifetime energy readings.