Smart plug sends negative energy values after being out of external power

So, everytime the plug is completely out of power for some time, it sends a negative value of energy at the first time it sends data. As far as i noticed, the longer the plug is off, the bigger is the value. It is some cheap one, which is recognized like this.

HA History
An example from History after several periods of being off.

HA Energy
1 day from Energy Dashboard

I tried to manually correct values in database, but this only makes it send even bigger negative value next time it sends data like to compensate everything i corrected. I’ve read few topics here and on other sources, but no answer was found. State class is total_increasing

Solved the problem by rotating the plug for 180 degrees thus changing place of live and neutral pins. For a few days no problems.