I have seen the following theorem on the book of Linear Algebra by Cemal Koç, and gave a counterexample, but this book is used as the main textbook for linear algebra courses in my university, so I'm assuming I'm missing something.
Let $E$ be an idempotent matrix different from the identity, then $\det(E) = 0$
CounterExample:
Let $F$ be a field with at least 2 idempotent element $q$ and $p$, then define $$E = \begin{bmatrix} q & 0\\0 & p\end{bmatrix}$$, so $$E^2 = \begin{bmatrix} q^2 & 0\\0 & p^2\end{bmatrix}$$ and $\det(E) \not = 0$.
Suppose $p$ is an idempotent element of a field. Then $p^2 = p$, so $p(p - 1) = 0$. This forces $p = 0$ or $p = 1$. This vitiates your counterexample.