When dealing with complex functions, if $f(x)$ has a simple pole, then we can find the coefficient $a_{-1}$ in the Laurent expansion $f(x) = \sum_{n=-1}^\infty a_n x^n$ by evaluating the limit $\lim_{x \to 0} f(x)x$.
I'm interested in an odd sort of edge case, where we force $a_{-1} = \infty$. For instance, consider the function $$f(x) = \sum_{n=1}^\infty n \frac{x^n}{1-x^n}$$ Each of these terms has a simple pole at $x=1$. So, if we tried to find the coefficient of the simple pole, we would obtain $$\sum_{n=1}^\infty n \frac{x^n}{1-x^n} = \sum_{n=1}^\infty n \left(-\frac{1}{n}\frac{1}{x-1} + \sum_{n=0}^\infty b_n (x-1)^n\right) = \left(-\sum_{n=1}^\infty 1\right)\frac{1}{1-x} + \sum_{n=0}^\infty c_n (x-1)^n $$
But this computation suggests $a_{-1} = - \sum_{n=1}^\infty 1$, which is infinite. And indeed, we do find that $\lim_{x \to 1} f(x)(x-1) = \infty$. However, to my surprise, $f(x)$ appears to actually have a second order pole at $x = 1$. In fact, computations suggest that $\lim_{x \to 1} f(x)(x-1)^2 = \zeta(2)$. So, it seems that somehow, the fact that $a_{-1}$ is infinite causes it to spill over to the next order pole.
This behavior continues for other powers of $n$, for instance,
$$\sum_{n=1}^\infty n^2 \frac{x^n}{1-x^n} = \left(-\sum_{n=1}^\infty n\right)\frac{1}{1-x} + \sum_{n=0}^\infty c_n (x-1)^n $$
And then $\sum_{n=1}^\infty n$ informally has a size of about $\infty^2$, so it should spill over to the next two poles. And $f(x)$ has a third order pole with $\lim_{x \to 1} f(x)(x-1)^3 = 2! \zeta(3)$. Likewise plugging in $n^3$ gives a fourth-order pole with $\lim_{x \to 1} f(x)(x-1)^4 = 3! \zeta(4)$.
An interesting case is $g(x) =\sum_{n=1}^\infty \frac{x^n}{1-x^n}$, since it should have a pole like $$\left(\sum_{n=1}^\infty \frac{1}{n}\right) \frac{1}{1-x}$$ $\sum_{n=1}^\infty \frac{1}{n} \approx \ln(\infty)$, so we should expect $g(x)$ to have a pole of order $\frac{\ln(1-x)}{(1-x)}$, and computationally, we see to have $\lim_{x \to 1} g(x) \frac{(1-x)}{\ln(1-x)} \approx 1$.
Question
A natural conjecture to make is that the leading term of the asymptotic of $\sum \frac{a_n}{n}$ determines the type of pole $f(x) = \sum_{n=1}^\infty a_n \frac{x^n}{1-x^n}$ has. In particular, if the leading term of $\sum \frac{a_n}{n} = g(n)$, then does the dominant pole of $f(x)$ have order $\frac{g\left(\frac{1}{1-x}\right)}{(1-x)}$?
I'm also curious about computing $\lim_{x \to 1} f(x) \frac{g\left(\frac{1}{1-x}\right)}{(1-x)}$. For instance, is there a way to establish the result that $$\lim_{x \to 1} \left((1-x)^k \sum_{n=1}^\infty n^k \frac{x^n}{1-x^n}\right) = (k-1)! \zeta(k)$$ Is there a systematic way to evaluate these limits in general?