Consider $P(X,Y)$ discrete and two chains $X \rightarrow Z$ and $X \rightarrow Z'$. Does then following inequality hold?
$$ P(X,Y,Z) = P(X,Y,Z') = P(X,Y) $$
In general, no. We have \begin{align} \mathbb{P}(X,Y,Z) = \mathbb{P}(Z|X,Y)\mathbb{P}(X,Y) \end{align} and \begin{align} \mathbb{P}(X,Y,Z') = \mathbb{P}(Z'|X,Y)\mathbb{P}(X,Y) \end{align} which does not satisfy $\mathbb{P}(Z|X,Y)=\mathbb{P}(Z'|X,Y)$ in general. However, you did not specify all dependencies between $X,Y,Z,Z'$. For equality to hold, we could satisfy $\mathbb{P}(Z|X,Y)=\mathbb{P}(Z'|X,Y)=1$ if $Z=f(X,Y)$ and $Z'=g(X,Y)$ for invertible functions $f,g$. The idea here is that knowing $X$ or $Y$ should give enough information to reconstruct $Z$ and $Z'$ perfectly, and hence, their conditional probabilities are one.