The cycle structure of the squaring map modulo $N$ was studied in [BBS,Sections 7 and 8].
A summary follows.
Let's assume that $N=pq$ for $p=2p'+1$ and $q=2q'+1$.
The cardinality of $QR_N:=\{x^2:x\in\mathbb{Z}_N^*\}$, the subgroup of quadratic residues modulo $N$, is $\phi(N)/4=p'q'$ (and not $\phi(N)$).
To see this, note that:
- $\mathbb{Z}_N^*\cong\mathbb{Z}_p^*\times\mathbb{Z}_q^*$ (Chinese remainder theorem);
- An $x\in\mathbb{Z}_N^*$ is a (quadratic) residue if and only if both $x\bmod{p}$ and $x\bmod{q}$ are residues in $\mathbb{Z}_p^*$ and $\mathbb{Z}_q^*$, respectively; and
- Exactly half the elements in $\mathbb{Z}_p^*$ and $\mathbb{Z}_q^*$ are residues (since $p$ and $q$ are primes).
Now, for your example: $N=35=5\cdot7=(2\cdot2+1)\cdot(2\cdot 3+1)$ and $|QR_{35}=\{1,4,16,29,11,9\}|=6$.
For the squaring map (or, for that matter, any exponentiation map with exponent $e$), we are essentially working in the multiplicative group modulo the order of the exponent, i.e., $\mathbb{Z}_{p'q'}^*$ for the squaring map over $QR_N$.
Therefore the length of a cycle induced by the squaring map in $QR_N$ depends on order of $2$ in $\mathbb{Z}_{p'q'}^*$, which divides $\lambda(p'q')$ (i.e., the length of the largest cycle in $\mathbb{Z}_{p'q'}^*$), where $\lambda$ is the Carmichael function..
This is usually fine since we pick large $p$ and $q$ and $p,q\neq 2$ (and therefore $2\in\mathbb{Z}_{p'q'}^*$).
However, for the case of $N=35$, $2\not\in\mathbb{Z}_{p'q'}^*$ but note that when you carry out $2,2^2,2^3...\bmod{6}$, it results in a cycle $2,4$.
You are possibly seeing sequences of length $3=2+1$ since you are starting off with a modular square root that is a non-residue (could you confirm?).
[BBS]: Blum, Blum and Shub, A Simple Unpredictable Pseudo-Random Number Generator, SICOMP'86