The Lagrangian formalism treats $x$ and $\dot{x}$ as independent variables. In particular, you cannot write $\frac{\mathrm{d}}{\mathrm{d}t}x$ because $x$ is not dependent on time.
What is dependent on time is a particular trajectory $x(t)$ that is the solution to the equations of motion (the Euler-Lagrange equations). Prior to solving the equations of motion, $x$ and $\dot{x}$ are independent variables (formally, coordinates of points in the tangent bundle of the configuration space which has the $x$ as coordinates), where you can choose any point $(x_0,\dot{x}_0)$ as an initial condition for the equations of motion since those are typically second order.
After solving the equations of motion, you can obviously obtain any value of $\dot{x}(t_1)$ on the trajectory from the corresponding $x(t_1)$ since the trajectory is a line - it has only the coordinate $t$, and points on it are fully specified by giving the time, and since you fed $(x,\dot{x})$ as the initial conditions $x(0) = x_0,\left(\frac{\mathrm{d}}{\mathrm{d}t}x\right)(0) = \dot{x}_0$ into the Euler-Lagrange equations, the trajectory indeed has the relation $\dot{x}(t) = \left(\frac{\mathrm{d}}{\mathrm{d}t}x\right)(t)$.