I'm working on a derivation of the geodesic equation from the action functional. In special relativity, specifically for flat spacetime, we assume that the metric tensor is constant (not necessarily that it's not a function of the coordinates, but that it traces out constant distances between any two points in space since the metric is what keeps track of distances in geometry; maybe saying "it's constant" is wrong in this case).
Anyhow, starting from the spacetime interval
$$ds^2 = g_{\mu\nu}dx^{\mu}dx^{\nu},$$
with signature $(+,-,-,-)$, the lorentz invariant action in flat spacetime is given by
$$S[x^{\mu}] = \int ds = \int |{\frac{ds}{d{\lambda}}| d{\lambda}}=\int d\lambda \sqrt{g_{\mu\nu} \dot{dx^{\mu}} \dot{dx^{\nu}}}.$$
Taking
$$S[x^{\mu}] = \int d\lambda L(x^{\mu}, \dot{x^{\mu}}),$$
the stationary action principle yields Euler-Lagrange equations nearly identical to those from classical, non-relativistic mechanics
$${\frac{\partial L}{\partial x^{\mu}} - {\frac{d}{ds}} {\frac {\partial L}{\partial \dot{x^{\mu}}} } = 0}.$$
The action is essentially the arclength of the worldline.
Now, every derivation I've seen online to derive the geodesic equation begins with assuming that the metric is describing non constant distances and is a function of the coordinates $x^{\mu}({\lambda})$, for scalar parameter ${\lambda}$. Then, most sources take the flat spacetime action as given above and take it's variation. The geodesic equation falls out upon taking the derivatives in the Euler-Lagrange equation properly (and this is commonly how the Christoffel symbol can be introduced).
My problem is, doesn't the term $ds/d{\lambda}$ get defined differently? Why is the derivative with respect to the parameter lambda the same if the metric is non-constant as a function of the coordinates (which are a function of the parameter). I think I'm missing something about the definition of arclength.