Coherent vortices with horizontal swirl arise spontaneously in the wave-driven nearshore surf zone. Here, a demonstration is made of the much greater robustness of coherent barotropic dipole vortices on a sloping beach in a 2D shallow-water model compared with fully 3D models either without or with stable density stratification. The explanation is that active vortex tilting and stretching or instability in 3D disrupt an initially barotropic dipole vortex. Without stratification in 3D, the vorticity retains a dipole envelope structure but is internally fragmented. With stratification in 3D, the disrupted vortex reforms as a coherent but weaker surface-intensified baroclinic dipole vortex. An implication is that barotropic or depth-integrated dynamical models of the wave-driven surf zone misrepresent an important aspect of surf-eddy behaviour.