That's true.
Conservation of energy is not a physical law. It's a consequence of mathematical theorem called Noether's theorem. All systems with certain differentiable symmetries have a corresponding conservation laws.
In a system that is not time translation invariant, energy don't have to be conserved. Expansion of universe breaks the time symmetry.