Suppose we have an infinite dimensional, separable Hilbert space and an operator $X$ on that Hilbert space for which we only know that
$$ X^2 + bX + c = 0 \qquad (1) $$
with $b,c \in \mathbb{R}$.
With $p,q\in \mathbb{C}$ and
$$ (X - p)(X - q) = 0 $$ $$ b = -p-q, \quad pq = c $$
we can introduce projection operators $E_{p,q}$ satisfying
$$ E_p + E_q = \text{id} $$ $$ E_p^2 = E_p, \quad E_q^2 = E_q, \quad E_p E_q = E_q E_p = 0 $$
and set
$$ X = p \, E_p + q E_q \qquad (2) $$
which obviously solves $(1)$.
Question: Are there other solutions for which X is not simply given by $(2)$ using a pair of projectors $E_{p,q}$?
Assume $p=q.$ Let $Y$ be an operator such that ${\rm Im}\,Y\subset \ker Y,$ i.e. $Y^2=0.$ For example let $v\perp w$ and $Y=\langle \cdot ,v\rangle w.$ Then $X=pI+Y$ satisfies $(X-pI)^2=0.$ The operator $X-pI$ cannot be represented as $X=aE+bF,$ where $E$ and $F$ are projections so that $EF=FE=0.$ Indeed if $$X-pI=aE+bF$$ then $$0=(X-pI)^2=a^2E+b^2F$$ Multiplying by $E$ leads to $a=0.$ Hence $b=0.$ Thus $X$ cannot be represented as a linear combination of two nontrivial commuting projections whose product is equal $0.$
Let $p\neq q.$ Then for $$Y={1\over p-q}X-{q\over p-q}I $$ there holds $Y^2=Y.$ Hence $Y$ is a projection and $$X=qI+(p-q)Y=pY+q(I-Y)$$ Summarizing the claim in OP holds if $p\neq q,$ but the projections $Y$ and $I-Y$ do not need to be orthogonal.