Your mistake is in your conservation energy equation. The way you wrote it is valid only when falling from infinity, from rest. The correct is: $$dE=dK+dU=0,$$ that is $$mvdv=-\frac{K}{x^2}dx,$$ where $K\equiv Gm_1m_2$. Integrating from $(x_i,v_i)$ to $(x,v)$ we get $$\frac 12m(v^2-v_i^2)=K\left(\frac{1}{x}-\frac{1}{x_i} \right).$$ This is the correct equation which you have to start with. Now $$v=\frac{dx}{dt}=\pm\sqrt{v_{i}^2+\frac{2K}{m}\left(\frac{1}{x}-\frac{1}{x_i} \right)}.$$ Assuming $v_i=0$ and integrating again from $(t=0,x_i)$ to $(t,x)$ we obtain $$t=-\int_{x_i}^{x(t)}\frac{dx}{\sqrt{\frac{2K}{m}\left(\frac{1}{x}-\frac{1}{x_i} \right)}},$$ where I am using the minus sign because the axis is oriented upwards. To solve this integral you use the substitution $x=x_i\sin^2{\theta}$, $$t=-\sqrt{\frac{2mx_i^3}{K}}\int_{\frac{\pi}{2}}^{\theta(x)}\sin^2{\theta}d\theta,$$ where $\theta(x)=\arcsin{\sqrt{\frac{x}{x_i}}}$. Therefore, $$t=\sqrt{\frac{mx_i^3}{2K}}\left[\frac{\pi}{2}-\arcsin{\sqrt{\frac{x}{x_i}}}-\frac 12 \sin\left(2\arcsin{\sqrt{\frac{x}{x_i}}}\right)\right].$$ However this equation cannot be solved for $x$.