Consider a codimension 1 surface, like a 2-dimensional sphere in 3 dimensions. We can compute geodesics of the surface via the Euler-Lagrange equation as great circles.
Now consider a codimension 2 surface. For example, consider the 2-dimensional surface parameterized by the equations:
$$x_1^2+x_2^2+x_3^2+x_4^2=1$$ $$x_4=0$$
Intuitively, it is clear that the geodesics of this surface are great circles of the sphere $x_1^2+x_2^2+x_3^2=1$ where $x_4=0$. However, if we compute geodesics of each surface independently, we get 4-dimensional great circles for the first equation and lines in the space $x_4=0$ for the second equation. The intersection of these two does not produce the correct geodesics of the 2-dimensional surface.
At what point do we include both equations to recover the geodesics of the 2-dimensional surface?