Your original equation is only correct when you mean m to be rest mass, which is actually denoted $m_{0}$. m is actually $\gamma m_{0}$ and is called relativistic mass.
You are finding conditions on the equation that make $E=m_{0}c^2$. Which ultimately give $P = 0$. Have you noticed that your reasoning has nothing to do with light?
You're just proving that $P=0$ when your condition is met.
Your mistake lies in the fact that you believe $E=m_{0}c^2$ holds in general. It does not. Only when momentum is zero does this hold.
The standard equation:
$$E=mc^2 = \gamma m_{0}c^2$$
Which I believe you were trying to assert is true always, is also not true in general. (instead of the equation with $m_{0}$)
Substituting this correctly, as you were trying to do, yields that when $E=\gamma m_{0} c^2$
$$P = \gamma m_{0} v$$
Which is the equation for momentum of a massive body.
This does not apply for light, since atleast in the context of classical electrodynamics, the field momentum is denoted by
$$P = \mu_{0} \epsilon_{0} \vec{S}$$
As pointed above, when $m_{0} = 0$, $E=pc$, which is the equation for the energy of light. ( which can also be independantly derived from maxwells equations)