An example, I hope.
Write $X \sqcup Y $ for disjoint union, say a set made up of two disjoint closed parts, one homeomorphic to $X$ and one homeomorphic to $Y$. And write $\bigsqcup_{i} X_i$ for a disjoint union of countably many closed sets homeomorphic to the $X_i$, "going to infinity" in the sense that any bouned interval meets only finitely many of them. Write $X \prec Y$ to mean there is a continuous bijection from $X$ to $Y$.
Let $P$ (or with subscripts) be a single point.
Let $Q$ (or with subscripts) be homeomorphic to $\{0\}\cup\{3^{-n}:n=1,2,3,\cdots\}$; a convergent sequence together with its limit.
Let $C$ (or with subscripts) be homeomorphic to the middle-thirds Cantor set in $[0,1]$.
My two sets are
$$
A = \bigsqcup_i P_i \sqcup \bigsqcup_i C_i
\\
B = \bigsqcup_i P_i \sqcup \bigsqcup_i C_i \sqcup Q
$$
Of course $A$ and $B$ are homeomprphic to closed subsets of $\mathbb R$.
For example, $A$ could consist of the negative integers, together with
Cantor sets in each of the intervals $[2i,2i+1]$.
The derived set $A'$ of $A$ is $\bigsqcup_i C_i$, and has no isolated point. But the derived set $B'$ of $B$ is $\bigsqcup_i C_i$ plus a single isolated point $Q'$. So $A$ and $B$ are not homeomprphic.
Now we have to observe
$$
\bigsqcup_i X_i = \bigsqcup_i X_{2i} \sqcup \bigsqcup_i X_{2i+1}
\tag{0}
$$
$$
\bigsqcup_i P_i \prec Q
\tag{1}
$$
$$
\bigsqcup_i C_i \sqcup P \prec C
\tag{2}
$$
$$
\bigsqcup_{i} C_{i} \sqcup Q \prec C
\tag{3}
$$
From these we get $A \prec B$ and $B \prec A$:
$$
A = \bigsqcup_i P_i \sqcup \bigsqcup C_i
= \bigsqcup_i P_i \sqcup\bigsqcup_i P_i \sqcup \bigsqcup C_i \prec
Q \sqcup\bigsqcup_i P_i \sqcup \bigsqcup C_i = B
$$
$$
B = \bigsqcup_i P_i \sqcup \bigsqcup C_i \sqcup Q =
\bigsqcup_i P_i \sqcup \bigsqcup C_i\sqcup \bigsqcup C_i \sqcup Q
\\ \prec\bigsqcup_i P_i \sqcup \bigsqcup C_i\sqcup C
=\bigsqcup_i P_i \sqcup \bigsqcup C_i = A
$$