Consider the Lagrangian for a spin 1 massless field with a gauge fixing term: \begin{equation} \mathcal{L}=-\frac{1}{4}F_{\mu\nu}^2-\frac{1}{2\xi}\left(\partial_\mu A^\mu\right)^2-J_\mu A^\mu, \end{equation} where $\xi$ acts as a Lagrange multiplier. Writing down the equation of motion for $A^\mu$ and inverting the corresponding operator leads to the following expression for the photon propagator: \begin{equation} i\Pi^{\mu\nu}(p)=\frac{-i}{p^2+i\epsilon}\left[g^{\mu\nu}-\left(1-\xi\right)\frac{p^\mu p^\nu}{p^2}\right]. \end{equation} Here, each different choice for $\xi$ corresponds to a different gauge.
On the other hand, going back to the Lagrangian, calculating the equation of motion for $\xi$ and excluding the case $\xi\rightarrow\infty$ gives \begin{equation} \partial_\mu A^\mu=0, \end{equation} which is the Lorenz gauge condition.
So it seems that, while I can choose different gauges for the propagator, I am enforcing a specific gauge condition with the equations of motion. How to solve this apparent contradiction? Is it because the fields are not always on shell, i.e. the classical equations of motion are not always satisfied?
Thanks.