The below texts are from the book Introduction to Analytic Number Theory by Apostol:
Suppose $k=7$. Then for $n=7$, $q= \gcd(7,7)=7>1$. So for any $a<7$, $a \equiv 1 \mod 1$ holds since $a-1$ is a multiple of $1$ for any $a$. But $\chi(a) \ne 1$ for any $a>1$ as the following table shows:
So how the theorem is true?
Added; The following is the proof of the above Theorem. I can't find any mistake in it but still don't know how/why $\chi(a)=1$ is inconsistent with the values for $\chi_i(n)$'s.



In the case of your supposed counterexample $n=k=7$, if $\chi$ is the trivial character, then certainly $\chi(a)=1$ for all $a=1,\dots,6$, and if $\chi$ is a nontrivial character, then we have $$ G(n,\chi)=\sum_{m=0}^6\chi(m)e^{2\pi i 7m/7}=\sum_{m=1}^6\chi(m)=0, $$ so the hypothesis that $G(n,\chi)\neq 0$ does not hold, and thus the theorem does not apply.