There are two distinct things going on here: formally "swapping" the arguments in the wavefunction, and physically moving the particles around. A priori, there is no reason the phase shifts from these two actions should be related.
You're focusing on the swap, but it's not interesting: your argument that the swap phase squares to 1 applies to both 2D and 3D equally well. When people talk about anyons, they're talking about the phase from moving the particles. That has more options in 2D because the paths one can take when moving particles around can have a greater range of topologies (https://en.wikipedia.org/wiki/Braid_group).
The reason that textbooks mix these things up is because in relativistic quantum field theories these two phases are always the same, by virtue of the spin-statistics theorem. But the anyons of condensed matter are nonrelativistic.
> To understand the quantum kingdoms, think of a drawing of loops. Imagine two indistinguishable particles, like electrons. Take one, then loop it around the other so that it ends up back where it started. Nothing seems to have changed. And indeed, in the mathematical language of quantum mechanics, the two wave functions describing the initial and final states must be either equal or off by a factor of −1. ... If the wave functions are identical, your quantum particles are bosons. If they’re off by a factor of −1, you have fermions.
This is nonsense. In 3D, you can't even define what it means to loop one particle around another, and there is nothing at all that says that fermions behave in a particular way when you loop them around some other particle.
f(x0, x1)
where x0 and x1 are coordinates of the two particles.
The fact that the particles are indistinguishable means that no possible experiment can tell them apart. After a bit of math, this means that f(x0, x1) = k * f(x1, x0) where k is a constant. All wavefunctions are normalized, so |k|^2=1, which constrains k to be on the unit circle.
But you can go farther: it's possible, at least in principle, to come up with an experiment that measures k. So you start with the particles in their initial state, do your experiment, and learn k. (Maybe you need to repeat it a bunch of times -- no big deal.) Now you repeat the same experiment but start with the two particles having their roles swapped. Since the particles are indistinguishable, you had better measure the same value for k. This means:
f(x0, x1) = k * f(x1, x0)
and also
f(x1, x0) = k * f(x0, x1) = k^2 * f(x1, x0)
So k^2 = 1, and that rules out everything except k=1 or k=-1.
> Imagine two indistinguishable particles, like electrons. Take one, then loop it around the other so that it ends up back where it started. Nothing seems to have changed. And indeed, in the mathematical language of quantum mechanics, the two wave functions describing the initial and final states must be either equal or off by a factor of −1.
As explained later in the article, in three or more dimensions, if you loop a particle around another and back where it started, you did nothing at all. The factor is 1, not -1.
The actual thought experiment is that you swap two indistinguishable particles. The resulting state must be the same up to a scalar factor k, since, if it wasn’t, you could tell the particles apart. Moreover, if you swap two particles twice, you end up exactly where you started, so k^2=1.
In two dimensions, this all breaks down a bit, and it gets very complicated very quickly.