I saw the proof which goes as follows:
$a^{n} \equiv 1 \pmod{a^{n}-1} $, and $n$ is the smallest power of a such that this is true.
We also know that by Euler's Identity $a^{\phi(a^{n}-1)}\equiv 1\pmod {a^{n}-1}$
So we get $n\mid \phi(a^{n}-1)$.
Now I am unable to understand where is the fact that $a>n$ is playing role?
It's not. Nothing in that proof requires $a>n$, and, indeed, the theorem is true for all $a>1,n\geq 1$.
For example, you gave $n=3,a=2$. But then $a^n-1=7$ and $3|\phi(a^n-1)=6$