The following proposition is sometimes used in distribution theory: for each fixed $z$ suppose that $T(X, z)$ has the distribution $Q$ and is independent of $Y$; then $T(X, Z(Y))$ has the distribution $Q$ and is independent of $Y$. An example is presented to show this result is false in general. Additional conditions under which the proposition becomes valid are presented.
"A Note on Substitution in Conditional Distribution." Ann. Statist. 3 (5) 1175 - 1179, September, 1975. https://doi.org/10.1214/aos/1176343248