If the exchange operator is viewed as a permutation operator (here on two particles), then $\hat P^2=\mathbb{I}$ follows because permuting twice two objects is equivalent to no permutation.
Within the context of spin statistics, exchange operators are viewed as permutation operators so, for two particles $\hat P^2=\mathbb{I}$ will always hold. For $n$ particles one will have $\hat P_\sigma^n=\mathbb{I}$ for any permutation $\sigma$, although there might be some smaller exponent $k$ for which some permutations satisfy $P_\mu^k=\mathbb{I}$. (Transpositions, which always permute only two particles, always satisfy
$\hat P_k^2=\mathbb{I}$.)
It is possible to replace the permutation groups by braid groups. In the simplest case of two particles then indeed exchanging two particles my give the same state multiplied by a non-trivial phase, but the braiding is non-commutative so that braiding 1 and 2 is not the same as braiding 2 and 1. Braid groups are much more complicated than permutations.
However, there are restrictions: if average values are to be independent of the labelling of the particles in a quantum state, only those representations of the permutation group which are one-dimensional can appear when the particles are indistinguishable. This also imposes restrictions on the possible braidings since complicated sequences of braiding involving multiple particles must transform not as a linear combinations of basis states but as a phase multiple of the initial state. For instance, braiding operations acting on the symmetric state
$$
\psi_a(x_1)\psi_b(x_2)+\psi_b(x_1)\psi_a(x_2)
$$
must produce the same global phase when braiding the states, whereas braiding $x_1$ and $x_2$ will produce the conjugate phase to braiding $x_2$ and $x_1$. The notion of indistinguishability is not so clearly defined because there is a "direction" to the braiding in the sense that one must identify which particle braids "on top" of the other.
————
Edit:
Maybe an example beyond 2 particles (which is somewhat trivial) would help.
Suppose you have a 3-particle system and you define
\begin{align}
P_{12}\psi(x_1,x_2,x_3)&=e^{i\lambda}\psi(x_2,x_1,x_3)\, ,\\
P_{23}\psi((x_1,x_2,c_3)&=e^{i\lambda}\psi(x_1,x_3,x_2)
\end{align}
Then what of $P_{12}P_{23}\psi(x_1,x_2,x_3)$? You would then pick up $e^{2i\lambda}$ (one phase for every permutation). But what to do with $P_{13}=P_{12}P_{23}P_{13}$? It’s a permutation of two particles but it’s written as a product of three permutations. Do you pick up $e^{i\lambda}$ or $e^{3i\lambda}$?
It only gets worse. Try inserting phases in a linear combination of product states and see if you can construct a fully symmetric or fully antisymmetric state up to a phase, i.e. explicitly construct a state $\psi(x_1,x_2,x_3)$ as a sum of products $\psi_a\psi_b\psi_c$ so that $P_{12}\psi(x_1,x_2,x_3)$ comes back to $e^{i\lambda}$ time itself, and
$P_{12}P_{23}\psi(x_1,x_2,x_3)$ also comes back to a multiple of itself.