WTH does the cost of electricity reset after a system restart, when the energy sensor it is using to calculate does not?

Yes it does multiply the current price by the kWh used, but it does not create a sensor. Not sure where you are getting that from.

In fact the difficulty of getting the the results from the Energy dashboard are the subject of a few WTH posts. People want these results as entities. But they don’t exist now. So you must be creating it some other way.