An easy lemma in number theory I'm trying to understand the following (easy) lemma.

Unfortunately, I must admit I'm stuck in understanding why in the second-to-last line that congruence is false.
In general that should be true, so I think it depends on the choice of $\gamma$, but how?
 A: About the second-to-last line proof, the first congruence $(1+p^\gamma q)^\ell \equiv 1\pmod{p^\gamma}$ is trivial. About the second one, instead, you have 
$$
(1+p^\gamma q)^\ell=\sum_{i=0}^\ell \binom{\ell}{i} (p^{\gamma} q)^{i} \equiv 1+\binom{\ell}{1}p^\gamma q \pmod{p^{\gamma+1}}
$$
hence $(1+p^\gamma q)^\ell \equiv 1\pmod{p^{\gamma+1}}$ if and only if $p^{\gamma+1}$ divides $\binom{\ell}{1}p^\gamma q$ if and only if $p$ divides $\ell q$. But $p$ is coprime with $q$, so this holds iff $p$ divides $\ell$. This has no reason to hold. However, just remove it and the proof will make sense. Also, in the first line of the proof there is a typo: that $z$ should be a $y$.
However, the statement is wrong. Counterexample:
$$
r=p+1,\,\,\, n=p> 2, \,\,\,\delta=1, \,\,\, m=p^x=p^2.
$$
Correct statement: Let $r,n,m,\delta$ be integers with $m\ge 2$ and $m \mid r^n-1$; let $p$ be an odd prime such that $p^x \mid m$ and $\delta \mid n$ and $p\nmid n/\delta$. Then $p\mid r^\delta-1$ implies $p^x\mid r^\delta-1$.
Correct proof: Denote by $\nu_p$ the $p-$adic valuation, then by lifting the exponent lemma
$$
x\le \nu_p(r^n-1)=\nu_p(r^\delta-1)+\nu_p(n/\delta) =\nu_p(r^\delta-1).
$$
Therefore $p^x \mid r^\delta-1$.
A: The Lemma isn't true as stated.
Example:   $$m=36,\; r=5,\; n=6, \;p=3$$
Then we have $$r^n\equiv 1 \pmod m$$ as desired.
We take $x=2$ and remark that  $3^2$ exactly divides $m$.
Let $\delta =2$.  Then we have $$3\,|\,5^2-1\quad \text {but} \quad 3^2\,\nmid \, 5^2-1$$
