# Example of pairwise exchangeable random variables that are not jointly exchangeable

A classical "counterexample" in probability is that of random variables that are pairwise independent but not jointly independent. I am interested in the existence of a similar example for exchangeable (but not independent) random variables.

In essence: Does there exist, for some $N\in\mathbb{N}$ and some random variables $X_1$, $\dots$, $X_N$, not independent (even pairwise), such that $X_1$, $\dots$, $X_{i-1}$, $X_{i+1}$, $\dots$, $X_N$ are exchangeable for all $i\in\{1,\dots, N\}$, but $X_1$, $\dots$, $X_N$ are not exchangeable?

Here is an example for $N=3$. Fix some integer $n\geqslant4$, choose some random variable $X_n$ uniformly distributed on $S_n=\{1,2,\ldots,n\}$, and assume that, for each $k$ in $S_n$, conditionally on $X_n=k$, either $(Y_n,Z_n)=(k+1,k+2)\bmod n$, or $(Y_n,Z_n)=(k-1,k-2)\bmod n$, with equal probabilities.
For example, $(X_4,Y_4,Z_4)$ is uniformly distributed on the set $$\{(1,2,3),(1,4,3),(2,3,4),(2,1,4),(3,4,1),(3,2,1),(4,1,2),(4,3,2)\}$$ For each $n\geqslant4$, $X_n$, $Y_n$ and $Z_n$ are uniformly distributed on $S_n$, $(X_n,Y_n)$ and $(Y_n,Z_n)$ are uniformly distributed on the set $$\{(k,\ell)\in S_n\times S_n\mid\ell=k\pm1\bmod n\}$$ and $(X_n,Z_n)$ is uniformly distributed on the set $$\{(k,\ell)\in S_n\times S_n\mid\ell=k\pm2\bmod n\}$$ Thus, $(X_n,Y_n)$, $(Y_n,Z_n)$ and $(X_n,Z_n)$ are exchangeable while $(X_n,Y_n,Z_n)$ is not since $(X_n,Y_n)$ and $(X_n,Z_n)$ are not identically distributed.
Edit: A simpler example is $X_n=Y_n$ uniformly distributed on $S_n$ and $Z_n=X_n\pm1$. This works for $n=2$... leading to an even simpler example: $(X,Y,Z)$ uniform on $\{(0,0,1),(1,1,0)\}$.
For continuous distributions, try $X=Y$ uniformly distributed on $(0,1)$ and $Z=1-X$. Or, some gaussian vector $(X,Y,Z)$, centered, with unit variances, and with covariances $\mathrm{Cov}(X,Z)$, $\mathrm{Cov}(Y,Z)$ and $\mathrm{Cov}(X,Y)$ not all equal.