I am computing the Matsubara sum $$S(i\omega_n) = \frac{1}{\beta}\sum_m \frac{1}{(i\omega_n - i\Omega_m +a)(\Omega_m^2 + b^2)}$$ where $\Omega_m$ is a bosonic Matsubara frequency. And, $\omega_n$ is a fermionic Matsubara frequency, not summed over.
From this Matsubara sum, I find a factor of $$\coth(\frac{\beta}{2}(i\omega_n + a)) \tag{1}$$ where $\omega_n = i\pi(2n+1)/\beta$ is the fermionic Matsubara frequency that is not summed over. By properties of hyperbolic functions, we have $$\coth(\frac{\beta}{2}(i\omega_n + a)) = \coth(i\pi n + i\frac{\pi}{2}+\frac{\beta}{2}a) = -\tanh(\frac{\beta}{2}a),$$ which is independent of the Matsubara frequency. This is trivially analytically continued. However, if I directly analytically continue the first expression $(1)$, I get $$\coth(\frac{\beta}{2}(\omega + a)),$$ which is very different. It depends on $\omega$, for one. Which procedure is correct and why? Note that the $\tanh$ expression seems to be used in the literature (as well as Wikipedia).