I am aware that the 4-momentum of a photon can be defined as:
$$p^{\mu}=\frac{dx^i}{d\lambda}\tag{1}$$
ie it is tangential to its worldline.
Geodesic equation for such a case:
$$\frac{du_i}{d\lambda}=\frac{1}{2}\frac{\partial g_{jk}}{\partial x^i}u^ju^k.\tag{2}$$
So for a stationary metric, $$\frac{dp_0}{d\lambda}=0,\tag{3}$$ i.e. $p_0=\text{constant}$ along worldline parametrized by $\lambda$.
I am also reading that in an inertial frame
$$p^{\mu}=\frac{E}{c}\left(1, \frac{\vec{p}}{|\vec{p}|}\right).\tag{4}$$
Lets say a photon travels from the surface of a gravitating object to infinity, meeting stationary observers along the way. To my understanding, they will not detect a change in its $p_0$ value, by the derivation above. This suggests that they will measure its energy to be the same (by second definition of $p^{\mu}$). This does not seem physical. Surely, as the photon leaves the surface of the gravitating object, it'll become redshifted, ie its frequency will change, so its energy must also change. That is in concflict with $p_0$ being stationary.
I think I am misinterpreting the meaning of my equations. What conceptual mistake am I making?