Example 3 Solve the equation
$$
x^{2}-x+1=\left(x^{2}+x+1\right)\left(x^{2}+2 x+4\right) \text {. }
$$
Let $t=x^{2}+x+1>0$. Then $t-2 x=t(t+x+3)$.
Factoring, we get $(t+2)(t+x)=0$.
Since $t+2>0$, we have
$$
t=x^{2}+x+1=-x \text{. }
$$

Solving, we get $x=-1$.