You produce energy at an amortized cost of $X /MW. You store energy efficiently (lithium batteries) at an amortized cost of $Y /MW back into the grid. You store energy inefficiently (Malta?) at an amortized cost of $Z /MW back into the grid.
If Z<< Y, then simply ramp up your input production and you are likely in the money. Also, I'm not sure what you mean by "Worse heat has fairly low energy density and cools over time"... energy density is not relevant at all when you have practically unlimited space to store power (GIANT) fields next to your solar/wind farms.