>>11651167The law of conservation of energy arises because of symmetries, in particular time translation symmetries. Energy is conserved if the physics of a system, for example the nature of the force field, stays the same over time. For every symmetry there's a conserved quantity.
However, the universe as a whole is not time symmetric. It looks different from one moment to the next, at least on cosmic scales where its expansion becomes significant. Energy is not conserved on those scales. This leads to dark energy and the accelerating expansion of the universe. Conservation of energy is invalid in the context of Einstine's theory of relativity due the potential time evolution of space. Landau-lifshitz pseudotensor might fix that, however...