So lets put a simple physical example to your photon above.
A) I am driving a car and I have an accident at 15mph running into a brick wall. I survive and after a brief stint in hospital get back to driving.
B) Unfortunately on the way home from hospital at 15mph I run up the tail of a slow moving bus doing 13mph. My injuries from this accident are so minor I am discharged within hours.
C) Resuming my trip home at 15mph I pull out to pass another slow bus. Unfortunately I pull out and run head on into a car doing 20mph coming the other way. I am pronounced dead at the scene.
I was moving at the same speed in the same car (and hence same energy I thought) in all three crashes, so why was the result of my crash so different ... what caused the energy of the crash to change?
In B my car appeared to have less energy in the crash hence my car was redshifted. In C my car appeared to have extra energy in the crash and hence my car was blueshifted. Those descriptions are exactly consistent to what you did to the photon above and I am using the same reference frames. So I ask your question now, what changes the car energy change as it drives along and where does the energy go and come from in the red and blue shift?
I am hoping you can clearly see my car energy never changed, what changed was the background AKA everything else.
Wait I am dead ... you caught a lucky break