Consider the cyclic graph with five vertices $a,b,c,d,e$ and add a sixth vertex $f$ with edges $af$, $bf$, $df$. Then $\omega(G)=\chi(G)=3$ and the graph is not perfect becaus the induced subgraph obtained by removing $f$ has $\chi=3$ and $\omega=2$.
Why is six minimal? For graphs up to four vertices, $\chi=\omega$ always holds, hence every graph with at most five vertices having $\chi=\omega$ is perfect.