When studying central forces it is possible to propose the Lagrangian:
$$ L = T-U=\frac{1}{2}m \dot{r}^2+\frac{1}{2}mr^2 \dot{\theta}^2 - U(r)$$
Then we can solve the equation of motions for $\theta$: $$ \frac{d}{dt}\frac{\partial}{\partial \dot{\theta}}L-\frac{\partial}{\partial \theta}L=0=\frac{d}{dt}\left( mr^2\dot{\theta}\right) \rightarrow mr^2\dot{\theta} = constant = l$$
Then $\dot{\theta} = l/mr^2$
Why can't I take this equality and put it into the Lagrangian $\mathcal{L}$ before solving the equations of motion for $r$? So:
$$ L = \frac{1}{2}m \dot{r}^2+\frac{l^2}{2 mr^2} - U(r) $$
$$ \frac{d}{dt}\frac{\partial}{\partial \dot{r}}L-\frac{\partial}{\partial r}L=0\rightarrow\frac{d}{dt}(mr)+\frac{l^2}{mr^3}+\frac{\partial}{\partial r}U(r)=0$$
The result would be obviously different if I solve the equations for $r$ and then substitute $\dot{\theta} = l/mr^2$:
$$L = \frac{1}{2}m \dot{r}^2+\frac{1}{2}mr^2 \dot{\theta}^2 - U(r)$$
$$\frac{d}{dt}\frac{\partial}{\partial \dot{r}}L-\frac{\partial}{\partial r}L=0\rightarrow\frac{d}{dt}(mr)-\frac{l^2}{mr^3}+\frac{\partial}{\partial r}U(r)=0$$
In this case, the difference is the sign on the angular momentum term. But in general, it is not the same at all. Why is solving the Euler-Lagrange Equation first the right approach?