If you really allow $Z$ to be any topological space, then no such example exists. If $X$ embeds as a proper subset of $Y$, then for any $y \in Y \setminus X$, we have open neighborhoods separating $X$ and $y$ (since $X$ is compact and $Y$ is Hausdorff). So if we let $Z = X \cup \{y\}$, then the inclusion of $X$ into $Z$ is an embedding. And clearly $Z$ is not homeomorphic to $X$ or $Y$ because it is not connected.

If you meant to require $Z$ to be a continuum, then an example is given by $X = [0,1]$ and $Y = S^1$. If $Z$ can be properly embedded in $Y = S^1$, then the embedding must miss at least one point of $Y$, so in fact $Z$ embeds in $(0,1)$. The only compact connected subsets of $(0,1)$ are closed intervals, hence homeomorphic either to $[0,1]$ or a point or empty. So if $X = [0,1]$ embeds in $Z$, then $Z$ is homeomorphic to $X$.

None of this requires assuming metrizability.