$\renewcommand{\Re}{\operatorname{Re}}$ $\renewcommand{\Im}{\operatorname{Im}}$ $\newcommand{\erf}{\operatorname{erf}}$ $\newcommand{\dag}{\dagger}$ $\newcommand{\const}{\mathrm{const}}$
Not all mechanics (leave alone physics) obeys variational principles. Consider system with Lagrangian $L=L(\mathbf{q}, \dot{\mathbf{q}},t)$. If there are no constrains, corresponding variational problem is for a functional \begin{equation} S=\int_{t_0}^{t_1}L(\mathbf{q}, \dot{\mathbf{q}},t)\,dt. \end{equation} and the Euler-Lagrange equations describe system correctly: \begin{equation} -\frac{d\,}{dt}L_{\dot{\mathbf{q}}}+L_{\mathbf{q}}=0. \end{equation}
If there are constrains \begin{equation} f_1(\mathbf{q},t)=f_2(\mathbf{q},t)=\ldots =f_m(\mathbf{q},t)=0, \end{equation} then one needs to consider a functional corresponding variational problem is for a functional \begin{equation} S=\int_{t_0}^{t_1}L^*(\mathbf{q}, \dot{\mathbf{q}},t)\,dt. \end{equation} with \begin{equation} L^*(\mathbf{q}, \dot{\mathbf{q}},t)= L(\mathbf{q}, \dot{\mathbf{q}},t)- \lambda_1(t)f_1(\mathbf{q},t)-\ldots -\lambda_m(t)f_m(\mathbf{q},t), \end{equation} and the Euler-Lagrange equations decribe system correctly: \begin{equation} -\frac{d\,}{dt}L_{\dot{\mathbf{q}}}+L_{\mathbf{q}}=\sum_j \lambda_j(t)f_{j, \mathbf{q}}; \end{equation} (plus constrains). Here $\lambda_j (t)$ are unknown functions.
However sometimes (in the problems with rolling) constrains are \begin{equation} \mathbf{a}_1(\mathbf{q},t)\cdot \dot{\mathbf{q}}=\ldots = \mathbf{a}_m(\mathbf{q},t)\cdot \dot{\mathbf{q}}=0, \end{equation} and this system cannot be integrated.
Then variational principles lead to \begin{equation} L^*(\mathbf{q}, \dot{\mathbf{q}},t)= L(\mathbf{q}, \dot{\mathbf{q}},t)- \lambda_1(t)\mathbf{a}_1(\mathbf{q},t)\cdot \dot{\mathbf{q}}-\ldots -\lambda_m(t)\mathbf{a}_m(\mathbf{q},t)\cdot \dot{\mathbf{q}}. \end{equation}
However, Euler-Lagrange equations for it (plus constrains) are not describing this system properly. Correct equations are \begin{equation} -\frac{d\,}{dt}L_{\dot{\mathbf{q}}}+L_{\mathbf{q}}=\sum_j \mu_j(t)\mathbf{a}_j \end{equation} (plus constrains).
One can write corresponding Euler-Lagrange equations and compare !
This leads to non-holonomic mechanics.