Where does the energy of light go, when it red-shifts? When talking about the expansion of the universe, it is said that it can be proven by the red-shifting of light.(As we would need higher than lightspeed to get this redshift by the Doppler effect)

I am an amateur, so I am not sure I am correct, but here is what I think.

Redshifting increases the wavelength of the light. higher wavelength = lower frequency = less energy.

So, if my assumptions are correct, where does this energy from the light go?
If not, where did I make an incorrect assumption?
The problem is that conservation of energy is a slippery concept in General Relativity. There are arguments back and forth but most people accept that conservation of energy is only a local law - it applies only to a local inertial frame and cannot be applied to the universe as a whole. However in an expanding universe it is very difficult to identify any inertial frames and certainly not ones that encompass a cosmologically significant volume.

What this means is that if you make a local "box" small enough that it is not affected by the expansion of the universe, then energy conservation will apply. But of course in such a box, a photon would enter and leave with the same energy because the box is unaffected by the expansion of the universe and so there would be no redshifting of the photon.