Search for heavy resonances decaying into a pair of $Z$ bosons in the $\ell^+\ell^-\ell'^+\ell'^-$ and $\ell^+\ell^-\nu\bar\nu$ final states using 139 fb$^{-1}$ of proton-proton collisions at $\sqrt{s} = 13$ TeV with the ATLAS detector