Let's first focus on $k$-by-$k$ matrices. We know that rank is a continuous function for idempotent matrices, so when we have, say, $\operatorname{rank}(A)>\operatorname{rank}(B)+1$, the two matrices cannot be close in norm topology.
But I wonder whether there is an explicit lower bound of the distance between two idempotent matrices in terms of their difference in their ranks.
Thanks!
The rank of an idempotent matrix is its trace, and $|\text{Tr}(A-B)| \le k \|A-B\|$, so if $\|A-B\| < 1/k$ they must have the same rank.
EDIT: Actually if $\|A - B\| < 1$ (where $\|\cdot\|$ is an operator norm) they must have the same rank. Suppose $\text{rank}(A) < \text{rank}(B)$ and $B$ is idempotent. Let $V = \text{Ran}(A)$ and $W = \text{Ran}(B)$. Then the restriction of $A$ to $W$ maps $W$ into $V$. Since $W$ has higher dimension than $V$, this map can't be one-to-one, so there is some nonzero $w \in W$ such that $Aw = 0$. But $Bw = w$, so $(B-A)w = w$ and $\|B-A\| \ge 1$.