For which values of $z$ does $$\sum_{n=1}^\infty \frac{\tan(nz)}{n^2}$$ converge? For which values of $z$ is the limiting function analytic?
One can show, as in this answer, that $$\left|\frac{e^{inz}-e^{-inz}}{e^{inz}+e^{-inz}}\right|$$ is bounded as $n\to \infty$, so long as $\text{Im}(z)\neq 0$. But the article above really does not discuss the case $\text{Im}(z)=0$, although it thinks it does. It doesn't deal with the poles at $\frac{(2k+1)\pi}{2}$, which can make some of the terms of the series undefined.
If $\text{Im}(z)=0$, obviously the estimate $$\left| \frac{e^{inz}-e^{-inz}}{e^{inz}+e^{-inz}} \right|\leq \frac{1+e^{2ny}}{|1-e^{2ny}|} $$
does not work. (Here $y=\text{Im}(z)$.) For $x\in \mathbb{R}$ of the form $j^2\frac{(2k+1)\pi}{2}$, there will be undefined terms.
Suppose there are no undefined terms. What can we say then about convergence? And in what way can we describe these singularities of the limiting function, corresponding to $x$ with undefined terms? Perhaps these points are not even isolated...