The property does not hold if the measure $\mu$ is atomic, so we assume that the given standard probability space $(X, \mathcal{B}, \mu)$ is nonatomic, whence it is isomorphic to he unit interval. Thus we may assume that $(X, \mathcal{B}, \mu)$ is the unit interval, endowed with the Lebesgue $\sigma$-algebra and measure. Let $\mathcal{P}=\{A_1,\ldots,A_n\}$ and $\mathcal{P'}=\{B_1,\ldots,B_m\}$. Denote $a_i:=\mu(A_i)$ for $i=1,\ldots, n$ and $s_k:=\sum_{i=1}^k a_i$ for $k=1,\ldots,n$. Now each $A_k$ is a standard measure space when endowed with the restrictions of the Lebesgue $\sigma$-algebra and of $\mu$ (see [1]). Thus, there exists a measure preserving transformation $f:[0,1] \to [0,1]$ such that $f^{-1}[s_{k-1}, s_k)=A_k$ up to measure zero. More precisely, $f:[0,1] \to [0,1]$ may be defined by
$$\forall k \in\{1,\ldots n\}, \quad \forall x \in A_k, \quad f(x)=s_{k-1}+\mu\Bigl(A_k \cap [0,x] \Bigr) \,.$$
Next, define $\psi:[0,1) \to [0,1]$
$$\forall k \in\{1,\ldots n\}, \quad \forall x\in [s_{k-1},s_k), \quad
\psi(x)= (x-s_{k-1})/a_k \,.
$$
Observe that $\psi$ preserves Lebesgue measure.
Finally, define
$\varphi: [0,1] \to [0,1]$ by $\varphi:=\psi \circ f$. Then $\varphi$ preserves Lebesgue measure $\mu$, and the partitions $\mathcal{P}$ and $\varphi^{-1}\mathcal{P'}$ are independent with respect to $\mu$.
Some further details: The isomorphism $f$ converts $\mathcal P$ into a partitions into intervals. Then $\psi$ is a piecewise affine map, taking each interval $f(A_k)=[s_{k-1,}s_k]$ onto $[0,1]$, so for each $B_j \in \mathcal P'$, the preimage $\psi^{-1}(B_j)\cap [s_{k-1,}s_k]$ is a copy of $B_j$, translated and shrunk by a factor of $a_k$. This yields the required independence.
[1] Bogachev, Measure Theory, Vol 2, Springer, Proposition 9.4.10 page 284 https://diendantoanhoc.org/index.php?app=core&module=attach§ion=attach&attach_id=12513