Take an hermitian operator $O$ such that $O|\psi\rangle = x|\psi\rangle$. The variance of an operator $O$ is defined as $$ (\Delta O)^2 = \langle{O^2}\rangle - \langle{O}\rangle^2.$$ Let's consider the first term, I would write it as
$$ \langle{O^2}\rangle = \langle\psi|O O|\psi\rangle = x\langle\psi|O|\psi\rangle = x^2\langle\psi|\psi\rangle = x^2.$$ But then for the second term I get the same result $$\langle{O}\rangle^2 = \langle\psi| O|\psi\rangle^2 = (x\langle\psi|\psi\rangle)^2 = x^2.$$ Therefore I end up with $(\Delta O)^2 = 0$ which is obviously wrong. What's the problem here?
The only idea I have is that $O^2|\psi\rangle \neq O(O|\psi\rangle)$, but i cannot understand why... What am I doing wrong?