Consider the scattering $$e^-(p_1)+e^+(p_2)\rightarrow e^-(p_1^\prime)+e^+(p_2^\prime)$$ at the tree-level via a internal photon line of four-momentum $q$. Using energy momentum conservation at the vertex, we get, $$p_1-p_1^\prime=q\Rightarrow q^2=2p_1\cdot q$$ where I used $p_1^2=p_1^{\prime 2}=m_e^2$. Note that $2p_1\cdot q$ is Lorentz invariant and I can evaluate in any frame. In the rest frame of the initial electron $p_1=(m_e,0,0,0)$ and $q=(E,0,0,E)$, we get, $$2m_eE=q^2$$ If we impose energy-momentum relation on the internal photon line too, i.e., $q^2=0$, I get, $$E=0\Rightarrow q=(0,0,0,0).$$ So the photon is not emitted at all! Therefore, we give up energy-momentum relation for the internal photon line, and treat it as a virtual particle.
But how to argue it for a process mediated by massive internal boson? For the weak process $$e^-(p_1)+e^+(p_2)\rightarrow \mu^-(p_1^\prime)+\mu^+(p_2^\prime)$$ mediated by massive $Z-$boson. Using the same line of argument, i.e., taking $p_1=(m_e,\textbf{0})$ and $q=(E_Z,\textbf{q})$, I arrive at $$2m_eE_z=M_Z^2.$$ But here, I don't find any contradiction in assuming the validity of energy-momentum relation for the internal Z-boson. However, the fact that the internal boson line is always virtual imply that there must be a contradiction! Can someone help me with this?