Wrong values in the energy-dashboard

Good morning everyone,

I have a problem with the energy statistics.
The following was the trigger:
We got a new electricity meter (unfortunately) and therefore the electricity had to be cut off. My HA installation is running on a Synology NAS which continues to run via UPS. The corresponding sensors (Shelly 3EM) are not, of course. Therefore, this has probably transmitted unavailable or 0 values.
After restarting the system, it now looks like this:

I then tried to find or eliminate the problem in the database (after backing up, of course). Unfortunately without success.

Regardless of whether I changed the wrong values, entered something else in last_reset, or deleted the last values completely, the wrong values reappeared after the next hourly update.

What can I do to fix this?