Where is the SUM coming from in the long term statistics

I have an issue with my SOLAR inverter sometimes resetting (growatt). This sucks, but via the chinese app (shinelink) the total sum does not change.

SInce I also locally get the data from the inverter via a proxy server this is captured via MQTT and written to an mariaDB.

Somehow the SUM does change after the resets. I dont know how this SUM is being calculated? I have no clue where the >16k KWh for example is spontaniously coming from now.

Does anyone has experience with this?