I am assuming $p$ is odd; a similar example is possible with $p=2$.
Let $ H = \langle x,y \mid x^{p^n} = y^{p^n} = [y,x]^{p^n} = [y,x,y] = [y,x,x] = 1\rangle$. Let $K = C_p\times C_p$. Then both $H$ and $K$ are capable, and hence so is $G=H\times K$. Capability if $K$ is trivial, and follows from the classical theorem of Baer on capable finitely generated abelian groups; capability of $H$ is not difficult, and a witness to the capability of $H$ is the $3$-nilpotent product of two cyclic groups of order $p^n$; you can also derive it from the characterization of the capable $2$-generated $p$-groups of class $2$ in my joint paper with Robert Morse, Certain homological functors of $2$-generator $p$-groups of class $2$, in Computational Group Theory and the Theory of Groups II, Contemporary Mathematics 511, AMS 2010.
Both $H$ and $K$ are of class (at most) $2$, hence so is $G$. $Z(G) = \langle [y,x]\rangle\times K\cong C_{p^n}\times C_p\times C_p$, so $Z(G)$ is not cyclic. Since $\Phi(G)=G^p[G,G]$, it follows that the generators of $K$ do not lie in $\Phi(G)$, so $Z(G)$ is not contained in $\Phi(G)$. And of course $G'=\langle [y,x]\rangle$ is cyclic.