In proper distance and proper time you will see the Shapiro delay, and the distance is also larger by the same amount. The speed of light remains c. That explains your concern
If we use coordinate time and distance yes the speed of light can be different, but coordinate speed of light means nothing invariant, it's just an artifact of the coordinate system selected.
You can see this in pg. 10 of the following, which explains and calculates the effect.
You can also see the graphic for the measured Shapiro delay (1 or 2 pages before) where you can see the delay is largest for the smaller impact parameter, i.e., when Venus was in (almost) superior conjunction with the Sun (that was the Shapiro measurement, Earth to Venus and back, of course they couldn't drill a hole through the Sun like you did). The delay is real, due to gravity (so, for instance, it is much bigger than the effect of the curved path if the light is skimming the surface of the Sun or not too far away) even apart from a curved path.
So there is no problem with momentum either, or energy.
Added as Edit from Comments below
If the photon/planet system emit gravitational waves in the postulated motion of the photon through the center of the planet ( big if, probably no, see below), then a small amount of momentum, and energy is carried away by the GW waves. Those will be lost by the 2 body system, and the oscillation of the photon through the planet will decrease in distance. No mystery if so, the energy and momentum they lose will go to infinity in GW waves. And if the photon looses energy and momentum (if one also the other), the freq will decrease, and it won't oscillate as far.
But, it'll be too small to measure, maybe 40 or so orders of magnitude smaller than the EM wave from an electron doing the same. But, worse, the photon-planet system has no quadrupole moment, only dipole (the angular momentum, and of course monopole, the mass), and thus cannot radiate. General Relativity doesn't allow monopole or dipole radiation – equivalently a spin two field can only radiate spin, or angular momentum, greater than 2-1 = 1, ie spin 2's, ie gravitons (for electromagnetic waves of spin 1, it has to be angular momentum greater than zero, ie, spin 1's, ie, photons).
The only way would be if the photon was orbiting the planet, I think that is a quadruple moment, and I think it's changing. Then they radiate. A changing quadrupole moment will radiate. But it still would be too small to measure – we did barely detect real gravitational radiation from 2 black holes.
The two black holes were orbiting each other, and that was a changing quadrupole moment. From a total of 65 (or so) solar masses we got about 3 solar masses of radiation when the grav field was 'super' strong near their horizons. In your case it would undetectable (when further away the effect was too small and we were not able to detect it).