I don't think that the Lagrangian that your teacher found is correct ?
you have two generalized coordinate die spring deflection $~r(t)~$ and the angle $~\varphi(t)~$
\begin{align*}
&\text{stating with the position vector}\\
&\mathbf{R}= \left[ \begin {array}{c} r\sin \left( \varphi \right)
\\ r\cos \left( \varphi \right) \end {array}
\right]\\
&\text{the kinetic energy}\quad,
T=\frac{m}{2}\mathbf{v}\cdot \mathbf{v}\quad,\mathbf{v}=\mathbf{\dot{R}}\\
& \text{the potential energy}\quad,
U=-m\,g\,\mathbf R_y-\frac{k}{2}\,r^2\\\\
&\text{the Lagrangian} \\
&\mathcal{L}=T+U =
\frac{1}{2}\left[m \left( {{\it pr}}^{2}+{r}^{2}{p\varphi }^{2} \right) -2\,mgr\cos
\left( \varphi \right) -k{r}^{2}
\right]
\end{align*}
with EL you obtain the EOM's
\begin{align*}
& {\ddot{r}}+{\frac {-m\,r{\dot\varphi }^{2}+m\,g\cos \left( \varphi \right) +k
r}{m}}
=0\\
&\ddot\varphi -{\frac {-2\,\dot\varphi \,{\dot r}+g\sin \left( \varphi
\right) }{r}}
=0
\end{align*}
put the time derivative in the EOM's equal zero and solve for $~r~,\varphi~$
you obtain the equilibrium state
$$r_0=-\frac{m\,g}{k}~,\varphi_0=0$$
thus:
the Lagrangian from the equilibrium state is:
$$\mathcal{L}=\mapsto\mathcal{L}(r=r-r_0,\varphi)$$