In Analytic Mechanics, the Lagrangian is taken to be a function of $x$ and $\dot{x}$, where $x$ stands for position and is a function of time and $\dot{x}$ is its derivative wrt time.
To set my question, lets consider motion of a particle along a line:
$$x: \mathbb{R} \to \mathbb{R} ~~as~~ t \mapsto x(t)$$
and take the Lagrangian to be:
$$L(x, \dot{x}) := \frac{1}{2}m\dot{x}^2 - V(x)$$
By applying the Euler-Lagrange equations:
$$ \frac{d}{dt}\left(\frac{\partial{L}}{\partial\dot{x}}\right) = \frac{\partial{L}}{\partial x}$$
we get back Newton's law of motion.
This follows formally where we consider $x$ and $\dot{x}$ as independent, but if we consider $\dot{x}$ as velocity, then it is indeed a function of position so when we partially differentiate $L$ wrt $x$ the $\dot{x}$-terms shouldn't vanish and this messes up the derivation. What am I misunderstanding?
edit
I am beginning to think that this is a non-question as some people seem to have suggested and I am being confused by the hand-wavy math in basic physics textbooks.
In the above example, let just consider $C$ to be the configuration space of the particle. Locally $C$ is given by the co-ordinate function $x: U \to \mathbb{R}$, the tangent bundle $\pi: TC \to C$ being locally trivial has as co-ordinate functions above $U$: $(x\circ \pi) \oplus dx: TU \to \mathbb{R^2}$.
We take the Lagrangian to be simply a functional: $TC \to \mathbb{R}$, which when written locally is in terms of $x$ and $\frac{\partial}{\partial x}$.
But, what about the dot in $\dot{x}$?
Say the particle traces out $\gamma: I \to C$, where interval $I$ is time. Let $\gamma(0) = p \in C$. Locally in terms of $x$, since we have $\gamma_{\ast}(\frac{d}{dt}\rvert_0)$ in $T_{p}C$, we get $dx(\gamma_{\ast}(\frac{d}{dt}\rvert_0)) = \dot{x \circ \gamma}(0)$, which we can abuse notation and write as $\dot{x}(p)$, so the corresponding point on the bundle looks like $(x(p), \dot{x}(p))$.
Does this make sense or have is there something I am still missing?

This is an excellent question! And the answer has its roots back in the origin of the Euler-Lagrange equations as solutions to Hamilton's variational principle.
Recall that the Euler-Lagrange equations are the result of extremising the action $$S(q[t]) = \int_0^T L(q, \dot q)\,dt.$$ It is conventional to write $L$ as function of $q$ and $\dot q$ (and this will lead to the cleanest formulation of the Euler-Lagrange equations) but it is by no means rigidly required: you could add $q^2$ as a third argument to the functional $L$, if you really wanted to, and of course $q$ and $q^2$ are not independent.
Now the usual derivation is to look at variations $\delta q(t), \delta q(0) = \delta q(T) = 0$, which yields
$$\frac{d}{ds}S(q[t]+s\delta q[t])\Bigg\vert_{s\to 0} = \int_0^T \left[(D_1 L)(q, \dot q)\delta q + (D_2 L)(q,\dot q) \delta \dot q\right]\,dt,$$ where $D_iL$ means differentiating $L$ with respect to the $i$th parameter. Notice that the above in no way requires that the values that are plugged in to $L$ (namely $q$ and $\dot q$) are independent! $D_1L$ is often written as $\frac{\partial L}{\partial q}$, but this is an abuse of notation: we are merely differentiating the two-parameter function $L$ with respect to its first argument, without knowing or caring what we will eventually plug into $L$.
Now we apply the usual integration by parts,
$$\int_0^T \left[(D_1L)(q,\dot q) - \frac{d}{dt}\left[(D_2L)(q,\dot q)\right]\right]\delta q = 0,$$ where the time derivative, unlike the two derivatives of $L$, happens after plugging in $q$ and $\dot q$, and we recover the usual equations of motion by taking $\delta q$ to be bump functions at all times in $(0,T)$.