Suppose, for example, we take a particle in polar coordinates $(r, \theta)$ with a central force, so $U = U(r).$ The Lagrangian is $$\mathcal{L} = \dfrac12 m (\dot{r}^2 + (r\dot{\theta})^2) - U(r).$$
The corresponding equation of motion for $r$ is $$m\ddot{r} = m\dot{\theta}^2r - \dfrac{\mathrm{d}U}{\mathrm{d}r}.$$
Using angular momentum conservation, $L = mr^2 \dot{\theta}$ is constant, so we can use it to eliminate $\dot{\theta}$ and obtain $$m\ddot{r} = \dfrac{L^2}{mr^3} - \dfrac{\mathrm{d}U}{\mathrm{d}r}.$$
However, suppose we return to the original statement of the Lagrangian and eliminate $\dot{\theta}$ there. Then we'd have $$\mathcal{L} = \dfrac12 m\left(\dot{r}^2 + \dfrac{L^2}{m^2r^2}\right) - \dfrac{\mathrm{d}U}{\mathrm{d}r}.$$
Applying the Euler-Lagrange equation $\dfrac{\mathrm{d}}{\mathrm{d}t}\dfrac{\partial \mathcal{L}}{\partial \dot{r}} = \dfrac{\partial \mathcal{L}}{\partial r}$ to the above, $$m\ddot{r} = -\dfrac{L^2}{mr^3}-\dfrac{\mathrm{d}U}{\mathrm{d}r}.$$
This is wrong; we can't eliminate $\dot{\theta}$ in the Lagrangian this way before applying the Euler-Lagrange equations, but why not?