This answer focus on the important issue of the question, which is explained in its body by OP.
Let me present an alternative way of thinking, which purges the "variable" mess, to clear up the confusion arising. Let's consider the Lagrangian $L=Kin-Pot.$
The Lagrangian, per se, is a function $L: \mathbb{R}^n \times \mathbb{R}^n \to \mathbb{R}$ (let's assume it doesn't depend on time, which would simply mean $L: \mathbb{R} \times \mathbb{R}^n \times \mathbb{R}^n \to \mathbb{R}$). No derivatives involved. In this case, it is
$$L(p,q)=\frac{1}{2}mq^2-V(p).$$
Now, let $\widetilde{\gamma}$ be the function $t \mapsto (\gamma(t),\dot{\gamma}(t))$.
The Euler-Lagrange equations then state that
$$(\nabla_1L) \circ \widetilde{\gamma} -\big((\nabla_2L)\circ \widetilde{\gamma}\big)'=0,$$
where $\nabla_1L$ means the first $n$ coordinates of the gradient and $\nabla_2L$ means the last $n$ coordinates.
Let's compute this in our case. It is clear that $\nabla_1L(p,q)=-\nabla V(p)$, and $\nabla_2 L(p,q)=mq$. Then the Euler-Lagrange equations say that
$$(\nabla_1L) \circ \widetilde{\gamma} -\big((\nabla_2L)\circ \widetilde{\gamma}\big)'=0$$
$$\implies (\nabla_1L) (\gamma(t), \dot{\gamma}(t)) -\big((\nabla_2L)(\gamma(t),\dot{\gamma}(t))\big)'=0$$
$$\implies -\nabla V(\gamma(t)) -(m \dot{\gamma}(t))'=0$$
$$\implies -\nabla V(\gamma(t))=m\ddot{\gamma
}(t),$$
which is what we would expect.
"Differentiating with respect to $\dot{x}$" is just a quicker way to think of the above process. However, it is naturally confusing, since the details of the process go down under the rug.