Considering redshifts, the energy of the photon is lost during its travel time, and conservation of energy appears to be violated. Unless the energy of the photon is being absorbed by a negative energy of the vacuum (dark energy), a more plosible explanation is presented below:

Because space stretches, the energy of light is spread over a larger length. Therefore, when you measure the flux of an astronomical object (energy per surface and time) you need to apply a dilatation factor to the time in order to capture the equivalent amount of energy. This factor is the ratio of scale factor a1/a0. Therefore, Watt observed = Watt emitted x a0/a1. Then using cosmological redshifts: Watt_observed/Watt_emitted = 1/(1+z) which is in agreement with Planck's law for the photon.

Because, each photon has les energy after being redshifted, in order to appy conservation of energy, you need to increase the number of photons as space stretches such that the overall energy amount is constant. My interpretation is that light is ondulatory, and corpuscular theory of light is not applicable in cosmology..