If $A^2=0$, then $\mathrm{rank}(A) \le \frac{n}{2}$ For my matrix algebra class I need to prove the following:

If $A^2=0$, prove $\mathrm{rank}(A) \le \frac{n}{2}$. So if A is nilpotent prove $\mathrm{rank}(A) \le \frac{n}{2}$.

I know already how to solve this, but my initial way of solving is false. I am looking for the mistake, but cannot find one. I know there already exists a question where this is asked. I'm just curious about my particular mistake.
Proof:
$A=\begin{bmatrix}a_1&&a_2&& ...&&a_n\end{bmatrix}$ and $A=\begin{bmatrix}a^T_1\\a^T_2\\...\\a^T_n\end{bmatrix}$
$AA=\begin{bmatrix}a_1 && a_2 && ... && a_n\end{bmatrix}\begin{bmatrix}a^T_1\\a^T_2\\...\\a^T_n\end{bmatrix}$
$=\begin{bmatrix}a_1a^T_1&&...&&a1a^T_n\\...\\a_na^T_1 && ...&& a_na^T_n\end{bmatrix}$
$=\begin{bmatrix} a_1 \cdot a_1&&...&&a_1 \cdot a_n\\...\\a_n \cdot a_1 && ...&& a_n \cdot a_n\end{bmatrix}$
$=0_{nxn}$
So we know the diagonal is zero thus
$a_i \cdot a_i = 0$
this equals $\vert\vert{a_i}\vert\vert^2$
The square root of this equals the length, therefore the length is equal to 0. The only vector with this property is the zero vector. Herefore all vectors $a$ must be equal to the zero vector.
The last however is not the truth, is there anyone who can spot my mistake?

Pretty late to the party but adding another way of solving since it's different and uses a nice idea, in case anyone stumbles upon this post for help.
We know from the Sylvester inequality $$\mathrm{rank}(XY)\geq\mathrm{rank}(X)+\mathrm{rank}(Y)-n$$
Setting $X=Y=A$ we get $$\mathrm{rank}(AA)\geq\mathrm{rank}(A)+\mathrm{rank}(A)-n$$ or equivalently $$\mathrm{rank}(A^2)\geq2\mathrm{rank}(A)-n$$ and since $$\mathrm{rank}(A^2)=0$$ because $A^2=O_n$, we get $$0\geq2\mathrm{rank}(A)-n$$ or equivalently $$\mathrm{rank}(A)\leq \frac{n}{2}$$ and we are done . $\square$
