The potential due to a dipole sheet, $S$, having dipole moment density, $\vec\tau$ (per unit area), is given by $$ \phi(\mathbf r) = \frac{1}{4\pi\epsilon_0}\int_S\frac{\vec\tau(\mathbf r')\cdot(\mathbf{r-r'})}{|\mathbf{r-r'}|^3} dS'. $$
Now, if I naïvely calculate $\mathbf E$ as $-\nabla\phi$ (as $\nabla$ operates only on $\mathbf r$, it will pass through the integral), then I'll get Dirac's delta in the integrand, meaning that $\mathbf E$ is $0$ everywhere ($\mathbf r$ not on the sheet, $S$), which is obviously wrong.
Question: What has gone awry? The same method yields correct results for electric field due to a charged sheet.