4. Given that the complex number $z$ satisfies $z^{2005}+\lambda z^{2004} \mathrm{i}-\lambda z-\mathrm{i}$ $=0$, where $\lambda$ is a real constant, and $\lambda^{2} \leqslant 1$. Then $|z|=$ ( ).
(A) $\frac{\sqrt{2}}{2}$
(B) $\left|\frac{\lambda+1}{\lambda-1}\right|$
(C) 1
(D) $\sqrt{1+\lambda^{2}}$
4.C.

From the given, we have $z^{2 \omega 0}=\frac{\lambda z+\mathrm{i}}{z+\lambda \mathrm{i}}$, let $z=a+b \mathrm{i}$. When $a^{2}+b^{2}>1$, we have $\lambda^{2}\left(a^{2}+b^{2}\right)+2 \lambda b+1>a^{2}+b^{2}+2 b \lambda+\lambda^{2}$
which simplifies to $\left(a^{2}+b^{2}-1\right)\left(\lambda^{2}-1\right)>0$.
However, since $a^{2}+b^{2}>1$, it follows that $\lambda^{2} \leqslant 1$, leading to a contradiction.
When $a^{2}+b^{2}<1$, similarly, we can derive a contradiction.
Therefore, $|z|=1$.