Can a group have a cyclical derived series? Given any group $G$, one can consider its derived series
$$G = G^{(0)}\rhd G^{(1)}\rhd G^{(2)}\rhd\dots$$
where $G^{(k)}$ is the commutator subgroup of $G^{(k-1)}$. A group is perfect if $G=G^{(1)}$ and thus has constant derived series, and solvable if its derived series reaches the trivial group after finitely many steps.
Is it possible for a group’s derived series to be cyclical, i.e. that $G \cong G^{(n)}$ for some $n>1$ and $G\not\cong G^{(k)}$ for all positive $k<n$?
Note that such a group could not be finite, solvable, nor co-Hopfian.

Note: this question was originally posted to Math.SE here.
In the comments there, it was observed that an infinitely generated free group is an example for which the group is not perfect while isomorphic to its derived subgroup. Whence the assumption above that $G$ is not isomorphic to its derived subgroup.
 A: So, let's turn the comments into answer. In this paper by B.H. Neumann, the author studies ascending series of groups $1=G_0 < G_1 < G_2 < \cdots$ in which $G_i' = G_{i-1}$ for all $i \ge 1$. Most of the paper is concerned with proving that such a series must terminate under certain hypotheses, but in Sections 9 and 10 he describes examples of infinite series of this form.
In the example in Section 9, we have $|G_1|=2$, and all other $G_i$ are infinite with centre $G_1$ of order $2$.
Now, following YCor's suggestion, let $G = \oplus_{n \ge 1} G_{2n}$ and $H = \oplus_{n \ge 1} G_{2n-1}$. Then, $G' \cong H$, $H' \cong G$ and, since $H$ has a direct factor of order $2$ but (by the above remarks) $G$ does not, we have $G \not\cong H$.
So the group $G$ has cyclical derived series with period $2$.
In fact, for any $p \ge 1$, we can split the direct sum of the $G_i$ into $p$ mutually disjoint direct factors of this form and, since only one of these $p$ factors has a direct summand of order $2$, this gives an example of a group with cyclical derived series of period $p$.
