In Quantum Mechanics, for coherent states $|z\rangle$ it can be prooved that if $|0\rangle$ is the vacuum state for an harmonic oscillator, therefore: \begin{equation} |z\rangle=e^{za^{\dagger}-z^*a}|0\rangle\equiv \hat{D}(z)|0\rangle \end{equation} with displacement operator $\hat{D}(z)$ that is unitary: $\hat{D}^{\dagger}(z)\hat{D}(z)=\hat{D}(z)\hat{D}^{\dagger}(z)=1$.
However, with some direct manipulations from the above stuff it can be shown that: \begin{equation} |z\rangle=e^{za^{\dagger}-z^*a}|0\rangle=e^{-\frac{|z|^2}{2}}e^{za^{\dagger}}|0\rangle \end{equation} where $D(z)\equiv e^{-\frac{|z|^2}{2}}e^{za^{\dagger}}$ isn't unitary.
Now the question is: how can be possible that in one case the operator is unitary and in the another not? Is there a "bug" in the proof in someway? I suppose the answer has to do with the fact that the Hilbert space in question is infinite dimensional but I would like a more rigorous answer mathematically and on what kind of physical consequences one has in either case.