Why doesn't this give Jefimenko's equations? By the Lorentz guage $\displaystyle \nabla \cdot \mathbf A = -\frac{1}{c^2}\partial_t \varphi\ $ one gets the inhomogeneous wave equations for the potentials
$$
\square^2 \varphi =  -\frac{1}{\epsilon_0}\rho, \qquad \square^2 \mathbf A =  -\mu_0\mathbf J \tag{I}
$$
where $\displaystyle \square^2 \equiv \nabla^2 - \frac{1}{c^2}\partial^2_t\ $. The solution are (the retarded potentials)
$$
\varphi = \frac{1}{4\pi\varepsilon_0}\int\frac{\rho(\mathbf r',t_r)}{\ell}d\tau', \qquad
\mathbf A = \frac{\mu_0}{4\pi}\int\frac{\mathbf J(\mathbf r',t_r)}{\ell}d\tau' 
$$
where $$\ell = |\boldsymbol{\ell}|, \quad
\boldsymbol{\ell} = \mathbf {r - r'}, \quad
\boldsymbol{\hat \ell} = \frac{\boldsymbol{\ell}}{\ell}, \quad
\displaystyle t_r = t - \frac{\ell}{c}
$$
Maxwell's equations can be decoupled for $\mathbf E$ and $\mathbf B$ to get the two equations
$$
\square^2 \mathbf E =  \frac{1}{\epsilon_0}\nabla\rho + \mu_0\partial_t\mathbf J,\qquad
\square^2 \mathbf B =  -\mu_0\nabla\times \mathbf J \tag{II}
$$
Now these two equtions are similar to the that of $\mathbf A$, with the $-\mu_0 \mathbf J$ in (I) replaced by $\frac{1}{\epsilon_0}\nabla\rho + \mu_0\partial_t\mathbf J$ and $-\mu_0\nabla\times \mathbf J$ in (II) respectively. So I think that it is possible to solve (II) by a retartded potential solution as for the case of (I).
If one attempts a retarded potential solution for $\mathbf B$ one gets
$$
\mathbf B(\mathbf r,t) = \frac{\mu_0}{4\pi} \int\left[ \frac{\nabla'_1\times \mathbf J(\mathbf r',t_r)}{\ell} \right]\, d\tau'  \tag{*}
$$
where $\displaystyle \nabla'_1$ denotes the differentiation wrt the first argument in $\mathbf J(\mathbf r',t_r)$ only, (as it should, right ?)
On the other hand, I expect the solution to be the Jefimenko's equation for magnetic field (as in Griffiths)
$$
\mathbf B(\mathbf r,t) = \frac{\mu_0}{4\pi} \int\left[ \frac{\mathbf J(\mathbf r',t_r)}{\ell^2} + \frac{\mathbf{ \dot{ J}}(\mathbf r',t_r)}{c\ell} \right] \times \boldsymbol{\hat{\ell}}\, d\tau'  \tag{**}
$$
but it doesn't seem that these two solutions are the same, not even in the static case!

So why solving
$$
\square^2 \mathbf A =  -\mu_0\mathbf J \tag{I}
$$
with retarded potential is correct but solving the similar equation (i.e. of the same mathematical form)
$$
\square^2 \mathbf B =  -\mu_0\nabla\times \mathbf J \tag{II}
$$
is not correct ?
 A: If there is something wrong please comment!
Taking total rotation gives
$$
\nabla'\times \mathbf J(\mathbf r',t_r) = \nabla'_1\times \mathbf J(\mathbf r',t_r) - \frac{1}{c}\mathbf{\dot J}(\mathbf r',t_r)\times \boldsymbol{\hat \ell}
$$
which implies
$$
\nabla'_1\times \mathbf J(\mathbf r',t_r) =  \nabla'\times \mathbf J(\mathbf r',t_r) + \frac{1}{c}\mathbf{\dot J}(\mathbf r',t_r)\times \boldsymbol{\hat \ell} \tag{1}
$$
On the other hand we have the product rule (with differentiation wrt $\mathbf r$)
$$
\nabla \times (f \mathbf A) = f(\nabla\times\mathbf A) - \mathbf A\times(\nabla f)
$$
If it is a (total) differentiation of $\displaystyle \frac{\mathbf J(\mathbf r',t_r)}{\ell}$ wrt $\mathbf r'$ then
$$
\nabla' \times \left(\frac{\mathbf J(\mathbf r',t_r)}{\ell}\right) = \frac{\nabla' \times\mathbf J(\mathbf r',t_r)}{\ell} - \mathbf J(\mathbf r',t_r)\times\left(\nabla' \frac{1}{\ell}\right)
$$
Which imples
$$
\frac{\nabla' \times\mathbf J(\mathbf r',t_r)}{\ell}  =  \nabla' \times \left(\frac{\mathbf J(\mathbf r',t_r)}{\ell}\right) + \mathbf J(\mathbf r',t_r)\times\left(\nabla' \frac{1}{\ell}\right) \tag{2}
$$
First substituting ($1$) in the integrand of ($*$) it becomes
$$
\frac{\nabla_1' \times\mathbf J(\mathbf r',t_r)}{\ell} = \frac{\nabla' \times\mathbf J(\mathbf r',t_r)}{\ell} + \frac{\mathbf{\dot J}(\mathbf r',t_r)}{c\ell} \times \boldsymbol{\hat \ell}
$$
Now substituting ($2$) we get
$$
\frac{\nabla_1' \times\mathbf J(\mathbf r',t_r)}{\ell} = \nabla' \times \left(\frac{\mathbf J(\mathbf r',t_r)}{\ell}\right) + \mathbf J(\mathbf r',t_r)\times\left(\nabla' \frac{1}{\ell}\right)  + \frac{\mathbf {\dot J}(\mathbf r',t_r)}{c\ell} \times \boldsymbol{\hat \ell}
$$
Since the integral is over all the space the integral of the first term will vanish (see below). Moreover $\displaystyle \nabla' \frac{1}{\ell} = -\nabla \frac{1}{\ell} = \frac{\boldsymbol{\hat \ell}}{\ell^2}$, that means the significant integrand is
$$
\frac{\mathbf J(\mathbf r',t_r)}{\ell^2}\times \boldsymbol{\hat \ell} + \frac{\mathbf{\dot J}(\mathbf r',t_r)}{c\ell} \times \boldsymbol{\hat \ell}
= \left[ \frac{\mathbf J(\mathbf r',t_r)}{\ell^2} + \frac{\mathbf{\dot{ J}}(\mathbf r',t_r)}{c\ell} \right] \times \boldsymbol{\hat{\ell}} 
$$
which is the integrand of ($**$), and therefore the equations ($*$) and ($**$) are equivalent. That is the retarded potential solution of (II) coincides with the Jefimenko's equation for $\mathbf B$.

The volume integral of the neglected term is transformed into a surface integral via
$$
\int_V \nabla'\times\mathbf F(\mathbf r') \,d\tau' = -\oint_{S(V)} \mathbf F\times d\mathbf a', \qquad \mathbf F(\mathbf r') = \frac{\mathbf J(\mathbf r',t_r)}{\ell}
$$
For the the integral (*) to exist, one should have $r^2|\nabla\times\mathbf J| \to 0 $ as $r \to \infty$, which implies (but I'm not sure) that $r^2|\mathbf J| \to 0 $ as $r \to \infty$ and it follows that the surface integral vanishes.
A: The electric and magnetic fields don't just obey the wave equations you wrote down, but also constraint equations
\begin{equation}
\nabla \cdot \mathbf{E}=\rho, \ \ \nabla \cdot \mathbf{B}=0
\end{equation}
Simultaneously satisfying the wave equation and the constraint equations modifies the solution you would naively guess from the unconstrained wave equation.
Additionally, the sources obey a continuity equation, which you may need to use to show equivalence with the standard form of  Jefimenko's equation.
Appendix A of these notes provides an argument to derive Jefimenko's equations without using the potentials.
A: Complete turn-around edit. Eqs. * and ** are indeed equivalent by partial integration.
As a side note, indeed the rotation only works on the unretarded current. The source of the wave equation for B is the retarded rotation of the current (at the source position), not to be confused with the rotation of the retarded current that is the source of the wave equation for A.
A: I post here relevant pages 58-59,515-516 from Electricity and Magnetism, 2nd Edition 1989, by Oleg Jefimenko :
pages 58-59,515-516
