Let:
$\nabla$ denote dell operator with respect to field coordinate (origin)
$\nabla'$ denote dell operator with respect to source coordinates
The electric field at origin due to an electric dipole distribution in volume $V$ having boundary $S$ is:
\begin{align} \int_V \dfrac{(\mathbf{M} \cdot \hat{r}) (\hat{r})}{r^3} dV &=-\nabla \left( \int_V \dfrac{\mathbf{M} \cdot \hat{r}}{r^2} dV \right)\\ &=-\nabla \left[ \int_V \mathbf{M} \cdot \nabla' \left( \dfrac{1}{r} \right) dV \right]\\ &=-\nabla \left[ - \int_V \dfrac{\nabla' \cdot \mathbf{M}}{r} dV + \int_V \nabla' \cdot \left(\dfrac{\mathbf{M}}{r} \right) dV \right] \\ &=-\nabla \left( \int_V \dfrac{-\nabla' \cdot \mathbf{M}}{r} dV + \oint_S \dfrac{\mathbf{M} \cdot \hat{n}}{r} dS \right)\\ &=\int_V \dfrac{-\nabla' \cdot \mathbf{M}}{r^2}(\hat{r}) dV + \oint_S \dfrac{\mathbf{M} \cdot \hat{n}}{r^2} (\hat{r}) dS\\ \end{align}
In the above equation, we applied the vector identity $\mathbf{A} \cdot \nabla\psi=-(\nabla \cdot \mathbf{A})\psi + \nabla \cdot (\psi \mathbf{A})$ and the divergence theorem.
If the origin point is not on boundary $S$ but inside $V$:
\begin{align} LHS&=\int_V \dfrac{(\mathbf{M} \cdot \hat{r}) (\hat{r})}{r^3} dV\\ &=\int_V \dfrac{(\mathbf{M} \cdot \hat{r}) (\hat{r})}{r^3}\ r^2 \sin\theta\ d\theta\ d\phi\ dr\\ &=\int_V \dfrac{(\mathbf{M} \cdot \hat{r}) (\hat{r})}{r}\ \sin\theta\ d\theta\ d\phi\ dr\\ \end{align}
$(1)$ Here the integrand contains a singular point and hence the integral diverges.
$$\text{}$$
\begin{align} RHS&=\int_V \dfrac{-\nabla' \cdot \mathbf{M}}{r^2}(\hat{r}) dV + \oint_S \dfrac{\mathbf{M} \cdot \hat{n}}{r^2} (\hat{r}) dS\\ &=\int_V \dfrac{-\nabla' \cdot \mathbf{M}}{r^2}(\hat{r})\ r^2 \sin\theta\ d\theta\ d\phi\ dr + \oint_S \dfrac{\mathbf{M} \cdot \hat{n}}{r^2} (\hat{r}) dS\\ &=-\int_V \nabla' \cdot \mathbf{M}\ (\hat{r})\ \sin\theta\ d\theta\ d\phi\ dr + \oint_S \dfrac{\mathbf{M} \cdot \hat{n}}{r^2} (\hat{r}) dS \end{align}
$(2)$ Here both the integrands contain no singular point and hence the integrals converge.
$(1)$ and $(2)$ contradicts. Why is there such a contradiction?