Are there cases where $\nabla\cdot\iiint\frac{\mathbf{J}(\mathbf{x}')}{\left|\mathbf{x}-\mathbf{x'}\right|}\mathrm{d}V' \neq 0$?

Why do you claim that $$ \int_V \nabla \cdot \frac{{\bf J}({\bf x}')}{|{\bf x}-{\bf x}'|} {\rm d}V' = -\int_V \nabla' \cdot \frac{{\bf J}({\bf x}')}{|{\bf x}-{\bf x}'|} {\rm d}V'$$? This doesn't seem to be true. You should have \begin{align} \int_V \nabla \cdot \frac{{\bf J}({\bf x}')}{|{\bf x}-{\bf x}'|} {\rm d}V' &= \int_V \Big(\nabla \frac{1}{|{\bf x}-{\bf x}'|}\Big) \cdot {\bf J}({\bf x}') {\rm d}V' =\\&= \int_V \Big(-\nabla' \frac{1}{|{\bf x}-{\bf x}'|}\Big) \cdot {\bf J}({\bf x}') {\rm d}V' = \\ &= \int_V \frac{1}{|{\bf x}-{\bf x}'|} \nabla' \cdot {\bf J}({\bf x}') {\rm d}V' - \int_V \nabla' \cdot \Big(\frac{1}{|{\bf x}-{\bf x}'|} {\bf J}({\bf x}') \Big){\rm d}V' =\\&= 0 - \int_{\partial V} \frac{1}{|{\bf x}-{\bf x}'|} {\bf J}({\bf x}') \cdot {\rm d}{\bf S}\end{align} and this vanishes if ${\bf J}$ vanishes fast enough. Note that if it doesn't vanish fast enough, then you may have problem with the convergence of integral $\iiint \frac{{\bf J}({\bf x}')}{|{\bf x}-{\bf x}'|} {\rm d}V'$ taken over the whole space; to make sure that it is well-defined, you need ${\bf J}$ to vanish fast enough, and that makes the boundary term to vanish at infinity.


Your idea on spheres of radius $R$ gives the hint; if the current density behaves well, the large distance of the surface from $\mathbf x$ will make the integral, in the limit $R\to\infty$, go to zero.

The situation considered is electric current flows without accumulation of charges; what goes into a region, also goes out of the region. This is very common in practice, total current going in equals total current going out. In practice, this current going in is limited, no matter how the boundary surface is chosen, because the current in single wire is finite and the number of wires is finite.

The integral in question can be divided into two parts, one due to current going in to the region, and one due to current going out of the region:

$$ \int_{\partial V} \mathbf j/r\cdot d\mathbf S = C_{in} + C_{out} $$ where $$ C_{in} = \int_{\partial V} \chi_{in}(\mathbf x')\mathbf j(\mathbf x')/r\cdot d^2\mathbf x' $$ and $$ C_{out} = \int_{\partial V} \chi_{out}(\mathbf x')\mathbf j(\mathbf x')/r\cdot d^2\mathbf x' $$ where $\chi_{in}$ is characteristic function of the part of the surface where the current goes in ($\mathbf j\cdot d\mathbf S < 0$).

Let us use the triangle inequality:

$$ \left| \int_{\partial V} \mathbf j/r\cdot d\mathbf S \right| \leq |C_{in}| +| C_{out}|. $$

So the integral will obviously go to zero if both $C_{in}$ and $C_{out}$ go to zero. These two going to zero is a sufficient condition (it may not be a necessary one).

Let the smallest $r=|\mathbf x - \mathbf x'|$ for some stage of the limiting process be denoted $r_{min}$. Of course, in the limiting process, the whole boundary has to expand to infinity, so $r_{min}\to\infty$.

$$ |C_{in}| \leq \int_{\partial V} \chi_{in}(\mathbf x')|\mathbf j(\mathbf x')\cdot d^2\mathbf x'|/r_{min} = \frac{I_{in}}{r_{min}} $$ where $I_{in}$ is (positive) value of current due to charges that come into the region. As long as this current does not grow too quickly with $r_{min}$, the contribution will go to zero as the boundary is expanded to infinity. Similarly for the other contribution.

So the sufficient condition for the surface integral to go to zero is that the electric current going in through the surface is not growing too fast as the surface is expanded. If the current is limited by a known maximum value no matter the boundary, as is the case if the system is made of finite number of (possibly infinitely long) wires of finite current, then the integral will go to zero. Thus one can consider arbitrary finite number of infinite wires, each carrying finite current. However, if the number of wires crossing the boundary increases as quick or more quickly than $r_{min}$, then there could be a problem and the integral may not have limit 0. This does not look like a common situation though.