I don't believe this is the case. The equation $$E^2 = (pc)^2 + (mc^2)^2$$ is derived using -
1) E=mc^2
2) p=mv
No it's not. You derive $$E^2 = (pc)^2 + (mc^2)^2$$ by taking the norm of the energy momentum 4 - vector:
$$ \underline{p} = \begin{pmatrix} \frac{E}{c} \\ \vec{p} \end{pmatrix}$$
$$ \underline{p}. \underline{p} = \eta^{\mu \nu} p_\mu p_\nu = \frac{E^2}{c^2} - \vec{p}.\vec{p}$$
Dimensional analysis shows this must be equal to $$(mc)^2$$ hence
$$\frac{E^2}{c^2} - \vec{p}.\vec{p}=(mc)^2 \Rightarrow E^2 = \vec{p}.\vec{p}c^2 + (mc^2)^2 $$
All we've assumed in this is that the contraction of a vector with the metric, $$ \eta^{\mu \nu} v_\mu v_\nu$$ is invariant under the symmetries of the metric, in this case the Lorentz group SO(1,3). If you take this equation and assume the particle is at rest, you get $$E= mc^2$$. On the other hand, if you assume the particle is massless you get $$E =pc$$, that since Note $$ \eta^{\mu \nu} p_\mu p_\nu$$ is a constant under Lorentz transformations, so must be $$(mc)^2$$ but since c is a constant, m must also be a constant. Therefore mass is invariant in special relativity.
Therefore if you substitute m0=0 to get E=pc from the above equation the initial equations namely E=mc^2 and p=mv should always apply.
You cannot say in general that these two equations are true. As I have shown above, $$E= mc^2$$ is a special case of $$E^2 = (pc)^2 + (mc^2)^2$$. Momentum is a little more tricky to show so I wont reproduce it now, but I can if you really want. The definition of momentum comes from Noether's theorem and states momentum is the conserved current that is related to the invariance of the action to spatial translations. For Newtonian mechanics you do the Noether procedure and come out with $$\vec{p} = m \vec{v}$$. For relativistic mechanics when you have a bigger symmetry group than Newtonian mechanics you get $$\vec{p} = \gamma(\vec{v}) m \vec{v}$$. In the non relativistic limit the Newtonian expression for momentum is recovered.
You cannot say that $$E^2 = (pc)^2 + (mc^2)^2$$ is valid for photon but the initial equations are not.
You're going the wrong way. $$E^2 = (pc)^2 + (mc^2)^2$$ is more general than the other equations you're using, not less.
Also the product of wavelength and frequency is constant. If you change the frequency the wavelength must be also be changed in the same proportion. The change in frequency will be canceled out by the change in wavelength anyway and momentum will remain the same.
It's true that the product of frequency and wavelength is a constant, but individually they are not invariant. You can only ever derive (correctly) a formula for p that includes either frequency or wavelength which should tell you that momentum is dependent on them. It would be independent it p depended only on the product $$\nu \lambda$$ but it does not.