Say we're dealing with magnetostatics ($\vec{\nabla} \cdot \vec{j} = 0 $). If we define $\vec{A}$ to satisfy $\vec{B} = \vec{\nabla} \times \vec{A}$, and we take the assumption that $\vec{\nabla} \cdot \vec{A} = 0$, then each component of $\vec{A}$ satisfies Poisson's equation ($\nabla ^2 \vec{A} = - \mu _0 \vec{j}$). This gives that the general form of $\vec{A}(\vec{r})$ is $$\vec{A}(\vec{r}) = \frac{\mu _0}{4\pi} \int d^3r' \frac{\vec{j}(\vec{r}')}{|\vec{r}-\vec{r}'|}.$$
However, if I take the divergence of the above expression, I should be getting $0$ based on the initial divergence-free assumption, but I'm not.
After product-rule expansion, I'm getting $$\vec{\nabla} \cdot \vec{A} = \frac{\mu _0}{4\pi}\int d^3r' \vec{j}(\vec{r}') \cdot \vec{\nabla}\Big(\frac{1}{|\vec{r}-\vec{r}'|}\Big),$$ where the first of the two product-rule terms went to $0$ because of $\vec{\nabla} \cdot \vec{j} = 0 $, but I still have that leftover stuff to integrate, and it's not clear why that needs to be $0$. Where did I mess up (or if I didn't, why does that need to be $0$?)