The real problem with questions like this is we are usually dealing with much more sophisticated models like general relativity and quantum mechanics. So energy conservation is a consequence of Noethers’s theorem.

Noether’s theorem says that whenever there is a symmetry in physical laws, we get some conserved quantity. For translations in space we get momentum conservation. For rotations conservation of angular momentum and for translations in time, we gets conservation of energy.

From what I can tell from reading around on various discussion groups involving physicists that know their general relativity is that many say that globally energy is not conserved in general relativity. I will read more and try and summarise my own understanding.

I think the thing I have read that I went on to discus with my class this morning is that the universe if the universe is closed and bounded then the cosmological constant is like a pressure term that drives the expansion. If the universe is expanding then work must be done against gravity. I told my students that this is where the energy goes, into the work done in driving the expansion.

I must admit I only really told them this as we are revising and I used it as a way to talk about distances being moved through force requiring work. If any of them go on to be cosmologist, and remember my dodgy answer then hopefully they will come back and tell me the answer to this question.