Please, Your Attention:
I have taken my time to work out a proof based on Dynkin's Multiplicative System Theorem, in the fashion on Exercise 14.7 in these notes. From the discussion that follows, I think that, unfortunately, the substitution rule cannot be proved for the general case, where the base probability space $\left( \Omega,\mathscr{F},\cal{P} \right)$ is arbitrary.
Here is why:
In order to use the Dynkin's Multiplicative System Theorem, we have to show that the class
\begin{equation}
\mathbb{F}\triangleq \left\{ g\in \left[ \mathscr{F}\times\mathscr{B}\left( \mathbb{R}^N\right) \right]_b \left| \mathbb{E} \left[ g\left( \cdot, X \right) | \mathscr{Y} \right] \left( \omega \right) = \mathbb{E} \left[ g\left( \cdot, X \left( \omega \right) \right) | \mathscr{Y} \right] \left( \omega \right), \quad \cal{P}-a.e. \right. \right\},
\end{equation}
where $\left[ \mathscr{F}\times\mathscr{B}\left( \mathbb{R}^N\right) \right]_b$ denotes the set of all bounded, jointly $\mathscr{F}\times\mathscr{B}\left( \mathbb{R}^N\right)$-measurable functions, is closed under bounded convergence, which means that, if $\left\{ g_n \in \mathbb{F}\right\}_{n\in\mathbb{N}}$ is a sequence of functions, such that
\begin{equation}
\sup_{\left( \omega, x, n \right) \in \Omega \times \mathbb{R}^N \times \mathbb{N}} \left|g_n\left( \omega, x \right)\right|=M<\infty,
\end{equation}
then
\begin{equation}
g_n \left( \omega,x \right) \underset{n\rightarrow\infty}{\longrightarrow} g\left( \omega,x \right),\quad\forall\omega,x\in\Omega\times\mathbb{R}^N
\quad\Rightarrow \quad g\in\mathbb{F}.
\end{equation}
So, suppose that
\begin{equation}
g_n \left( \omega,x \right) \underset{n\rightarrow\infty}{\longrightarrow} g\left( \omega,x \right),\quad\forall\omega,x\in\Omega\times\mathbb{R}^N.
\end{equation}
Since the convergence is pointwise, for every random element $X:\Omega \rightarrow\mathbb{R}^N$, it must be true that
\begin{equation}
g_n \left( \omega,X\left(\omega\right) \right) \underset{n\rightarrow\infty}{\longrightarrow} g\left( \omega,X\left(\omega\right) \right),\quad\forall\omega\in\Omega.
\end{equation}
Now, since $g_n\in\mathbb{F}$, for all $n\in\mathbb{N}$, the desired property holds, that is,
\begin{equation}
\mathbb{E} \left[ g_n\left( \cdot, X \right) | \mathscr{Y} \right] \left( \omega \right) = \mathbb{E} \left[ g_n\left( \cdot, X \left( \omega \right) \right) | \mathscr{Y} \right] \left( \omega \right)\equiv
\mathbb{E} \left[ g_n\left( \cdot, x \right) | \mathscr{Y} \right] \left( \omega \right)|_{x=X\left( \omega \right)},\quad\forall\omega\in\Omega_{\Pi_1},
\end{equation}
where ${\cal{P}} \left( \Omega_{\Pi_1} \right)=1$, with $\Omega_{\Pi_1}$ being independent of $n$. Note that such an $ \Omega_{\Pi_1}$ exists, since $\mathbb{N}$ is countable.
We would like to show that the desired property holds also for the limit $g$. On the one hand, since everything is bounded and $\cal{P}$ is finite, invoking the Dominated Convergence Theorem for conditional expectations, we get
\begin{equation}
\mathbb{E} \left[ g_n\left( \cdot, X \right) | \mathscr{Y} \right] \left( \omega \right)
\underset{n\rightarrow\infty}{\longrightarrow}
\mathbb{E} \left[ g\left( \cdot, X \right) | \mathscr{Y} \right] \left( \omega \right),\quad\forall\omega\in\Omega_{\Pi_2},
\end{equation}
where ${\cal{P}} \left( \Omega_{\Pi_1} \right)=1$. This in turn implies that
\begin{equation}
\mathbb{E} \left[ g_n\left( \cdot, x \right) | \mathscr{Y} \right] \left( \omega \right)|_{x=X\left( \omega \right)}
\underset{n\rightarrow\infty}{\longrightarrow}
\mathbb{E} \left[ g\left( \cdot, X \right) | \mathscr{Y} \right] \left( \omega \right),\quad\forall\omega\in\Omega_{\Pi_1}\cap\Omega_{\Pi_2}\triangleq\Omega_{\Pi_3},
\end{equation}
where, of course, ${\cal{P}} \left( \Omega_{\Pi_3} \right)=1$.
And this is the point where the problems start.
Again invoking the Dominated Convergence Theorem for conditional expectations, it is true that, for each fixed $x\in\mathbb{R}^N$, there exists an event $\Omega_x$ with ${\cal{P}} \left( \Omega_x \right)=1$, such that
\begin{equation}
\mathbb{E} \left[ g_n\left( \cdot, x \right) | \mathscr{Y} \right] \left( \omega \right)
\underset{n\rightarrow\infty}{\longrightarrow}
\mathbb{E} \left[ g\left( \cdot, x \right) | \mathscr{Y} \right] \left( \omega \right),\quad\forall\omega\in\Omega_x,
\end{equation}
But $\mathbb{R}^N$ is uncountable! Therefore, in general, we may not be able to find a global, independent of the particular $x$ event of full measure, such that the above holds. As a result, the above cannot be guaranteed to hold if $x$ is replaced by $X\left(\omega\right)$.
Consequently, under this general setting, the class $\mathbb{F}$ cannot be guaranteed to be closed under bounded convergence. Maybe further assumptions are needed.
I really hope I am wrong...
But my conclusion is reinforced by Jason Swanson's Remark 3.11, in these other notes.
Now, we now that the result is true if a regular conditional distribution of $\omega\triangleq Z\left(\omega\right) | \mathscr{Y}$ exists.
But existence of such a regular conditional distribution cannot be guaranteed in general, when the structure of $\left( \Omega,\mathscr{F},\cal{P} \right)$ is arbitrary.
I would be glad to see your comments.