Daily Utility Meter occasionally does not reset itself / reinstates the value from previous day

Occasionally the daily utility meter I’ve created does not properly resets itself and restores previous day value after 10minutes (see the graph below). Any ideas why and how to fix it? I can correct the data manually by modifying the core.restore_state file, but only when I notice it, if I miss it after the day passes I have a bad value in the history I cannot do anything about.

What’s the source sensor doing?

Acting normal so it seems to be a problem with utility meter implementation in HA.