Based on your comments to this answer, you seem to be in the situation where $\pi_2(Z)$ is a free $\mathbb{Z}\pi_1(X)$-module, and where the map $\pi_1(X)\to \pi_1(Y)$ is an iso. Under those assumptions, the answer should be a consequence of the following diagram, coming from the map between the mapping cylinders :

$$\require{AMScd}\begin{CD}
0@>>>\pi_2(Y)@>\varphi_3>>\pi_2(M_h,X)@>\varphi_2=0>>\pi_1(X)@>\varphi_1>>\pi_1(Y)\\
@VVV@VVV@VVV@VVV@VVV\\
0@>>>\pi_2(Z)@>>>\pi_2(M_{f\circ h},X)@>\varphi'_2>>\pi_1(X)@>>>\pi_1(Z)\\
@VVV@VVV@VVV@VVV@VVV\\
0@>>>\pi_2(Y)@>\varphi_3>>\pi_2(M_h,X)@>\varphi_2=0>>\pi_1(X)@>\varphi_1>>\pi_1(Y)\\
\end{CD}$$

Now, by assumption, $\varphi_1$ is an iso. This implies that its kernel is $0$, which means that $\varphi_2=0$. This means in turn that $\varphi_3$ is an iso. But then, by assumption $\pi_2(Z)$ is a free $\mathbb{Z}\pi_1(X)$-module, and so $\pi_2(M_h,X)\simeq\pi_2(Y)$ is a projective $\mathbb{Z}\pi_1(X)$-module since it is a direct summand of $\pi_2(Z)$.

In addition, using the commutativity of the diagram, we get that $\varphi'_2=0$, which means that $\pi_2(M_{f\circ h},X)$ is isomorphic to $\pi_2(Z)$, and in particular it is a free $\mathbb{Z}\pi_1(X)$-module.