5 LIFE HACKS BASED ON SCIENCE

I have a hypothetical situation. Imagine an ordinary star out in space. The universe is expanding and there are two observers. One observer is on the red shift side of the star, the other is on the blue shift side of the star. In the center of the star, two identical photons are released at the same time. Both have a wavelength of 500 nm. Which means, based on this formula, E=hc/λ, the energy of each photon is 2.4796 eV. One photon moves toward the observer on the red shift side of the star, the other photon moves toward the observer on the blue shift side of the star.  When the blueshift photon reaches the blueshift observer, it has a wavelength of 400 nm which means that it has 3.0995 eV of energy. When the redshift photon reaches the redshift observer, it has a wavelength of 600 nm, which means that it has 2.0663 eV of energy.
So, the blueshift photon has more energy. Where did it come from?
The redshift photon has less energy. Where did the energy go?
Also, from the photons' point of view, aren't they still 500 nm?