I am trying to solve for the equations of motion to simulate a spherical pendulum. I decided to use the spherical coordinates. The Lagrange equation is, $$ L=T-V=\frac{1}{2}m\left(L\dot\theta\right)^2+\frac{1}{2}m\left(L\sin\theta\dot\phi\right)^2-\left(-mgL\cos\theta\right), $$
where $L$ is the length of the rope, $ϕ$ is the angle of the projection of the rope on $x$-$y$ plane with $x$-axis and $θ$ is the angle with the $-z$-axis
I solved these equations: \begin{align} \frac{\mathrm d}{\mathrm dt}\left(\frac{\partial L}{\partial\dot\theta}\right)-\frac{\partial L}{\partial\theta}&=0, \\ \frac{\mathrm d}{\mathrm dt}\left(\frac{\partial L}{\partial\dot\phi}\right)-\frac{\partial L}{\partial\phi}&=0, \end{align}
and I got $$ \ddot\theta=\sin\theta\cos\theta\dot\phi^2-\frac{g}{L}\sin\theta $$ and $$ \frac{\mathrm d}{\mathrm dt}(mL^2\sin^2θ\dot\phi) = 0 $$ This seems like the change in angular momentum is conserved. But when I solve it more
$$ \ddot\phi = -2\dot\phi\dot\theta\cot\theta $$
This does not make sense to me because it goes to infinity when θ goes to 0. Any ideas on what I am doing wrong?