Let $X$ and $Y$ be identically distributed bounded random variables defined on a probability space $(\Omega,\mathcal{F}, \mathbb{P})$. I want to know if there always exists an invertible measure-preserving transformation $T: \Omega \to \Omega$ such that $ X \circ T= Y$ holds almost surely.

When $X$ and $Y$ are characteristic functions, this is essentially proven in page 74 of Halmos's Lectures on Ergodic theory. Before attempting to prove the general statement myself, I want to ask if this is possibly a standard result. I would very much appreciate any suggestions or references.