Edit: This answer only makes sense if the actual question was about morphism $X \to A$ and not $X \to Z$.
Couldn't you just pick a category with two objects $x, y$ with only one invertible morphism $f$ between the two of them? Then consider $$ x \to x \to y \to x $$ with the morphism $x \to x$ being the identity. If we let $W$ be the subcategory consisting of $x, y$ but not the morphism between them, then it satisfies your condition that $X \to Y$ and $Y \to A$ (both of which are just the identity $x \to x$), but not that $x \to y$ or $y \to x$ are in $W$.
In this case, $W$ satisfies the 2-implies-3, since if the diagrams $$ X \to Y \to Z $$ have 2 morphisms that are in $W$, then they must be of the form $x \to x \to x$ or $y \to y \to y$, and so it satisfies the 2-implies-3 condition.