If a commutator has an eigenvalue $0$, do the two operators share an eigenvector?

Clearly we can pick a basis so that one of the operators is diagonal already. Here's a small counterexample of this sort: $$ A = \begin{pmatrix} \lambda & 0 & 0 \\ 0 & \lambda & 0 \\ 0 & 0 & \mu \end{pmatrix} \qquad B = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}. $$ The eigenvalues of $B$ are $\pm \sqrt{2}$ and $0$, and all eigenvectors are of the form $(1,a,\pm 1)$, none of which live in one of the eigenspaces of $A$. But $AB-BA$ has first row and first column all zero, so $(1,0,0)$ is an eigenvector with eigenvalue zero.


Take $A,B$ to be $4 \times 4$ matrices such that the first column of $A$ is $e_2$, the last column of $A$ is $e_3$, the second column of $B$ is $e_3$, and the first column of $B$ is $e_4$. Then

$$(AB-BA)e_1=ABe_1-BAe_1=Ae_4-Be_2=e_3-e_3=0.$$

(The point of the choices was to create two "parallel paths" from $1$ to $3$, namely $1 \to 4 \to 3$ and $1 \to 2 \to 3$.)

Notice though that the choices we made here did not create an invariant subspace yet: $A$ sends the span of $\{ e_1,e_4 \}$ to the span of $\{ e_2,e_3 \}$ and $B$ sends the span of $\{ e_1,e_2 \}$ to the span of $\{ e_3,e_4 \}$. So these choices do not uniquely specify any eigenvectors of either matrix. Thus taking the other two unspecified columns of $A$ and those of $B$ at random will typically give all different eigenvectors.