To find the residue I used the residue theorem that states:
$$Res(f,z_0)=\frac{1}{(m-1)!}\lim_{z\to0}\frac{\mathrm{d}^{m-1}}{\mathrm{d}z^{m-1}}(z-z_0)^m f(z)$$ where $m$ is the order
Computing the Residue of $\dfrac{\cot(\pi z)}{z^2}$ This is what I thought I was supposed to do for the singularity at $z_0=0$ of order $3$.
$$Res(f;0)=\frac{1}{2!}\lim_{z\to 0} \frac{\mathrm{d}^2}{\mathrm{d}z^2}z^2 \sin(\pi z)f(z)=-\frac{1}{2}\lim_{z \to 0} \pi^2 \cos(\pi z) =-\frac{\pi^2}{2}$$
However the answer is $-\dfrac{\pi}{3}$
I'd really appreciate any guidance in where I went wrong.
If one wishes to proceed using the limit formula for higher order poles, then one can write
$$\begin{align} \text{Res}\left(\frac{\cot(\pi z)}{z^2},z=0\right)&=\frac12 \lim_{z\to 0}\frac{d^2}{dz^2}\left(z^3\,\frac{\cot(\pi z)}{z^2}\right)\\\\ &=\frac12 \lim_{z\to 0}\frac{d^2(z\cot(\pi z))}{dz^2}\\\\ &=\frac12 \lim_{z\to 0}\left(2\pi \frac{(\pi z)\cos(\pi z)-\sin(\pi z)}{\sin^3(\pi z)}\right)\\\\ &=\pi \lim_{z\to 0} \left(\frac{(\pi z)-\frac12 (\pi z)^3+O\left(z^4\right)-(\pi z)+\frac16 (\pi z)^3+O\left(z^5\right)}{(\pi z)^3+O\left(z^4\right)}\right)\\\\ &=-\frac{\pi}{3} \end{align}$$
as expected!
However, since the residue is the coefficient of the $z^{-1}$ term in the Laurent expansion, one can proceed as
$$\begin{align} \frac{\cot(\pi z)}{z^2}&=\frac{1-\frac12 (\pi z)^2+O\left(z^4\right)}{\pi z^3-\frac16 \pi^3z^5+O\left(z^7\right)}\\\\ &=\frac{\left(1-\frac12 (\pi z)^2+O\left(z^4\right)\right)\left(1+\frac16 (\pi z)^2+O\left(z^4\right)\right)}{\pi z^3}\,\\\\ &=\frac{1}{\pi z^3}-\frac{\pi/3}{z}+O(z) \end{align}$$
where we see that the residue is indeed $-\pi/3$.