You're right, 𝑥′−𝑥′𝑝(𝑡′)=𝛾″(𝑥″−𝑥″𝑝(𝑡″)) is the problem. It turns out to be right only if the particle is at rest in the primed frame -- that's why everything works for the first transformation. The general case is that you have $F(x,t)$, a function of the coordinates of the spacetime event $(x,t)$ and you want to write it in terms of $x'$ and $t'$. In theory that's easy since you just use the (inverse) Lorentz transformation: $x=\gamma(x' + \beta t')$ and $t=\gamma(t' + \beta x')$. Just plug these in for $x$ and $t$ to write $F$ in terms of $x'$ and $t'$. In your case you are looking at the function $F(x,t) \equiv \delta\left(x-x_p(t)\right)$, where $x_p(t)$ is itself a function that gives the x-coord of the particle at time $t$ in the unprimed frame. You want to write this as a function of $x'$ and $t'$ (the Lorentz transformation of $(x,t)$). After we rewrite it as a function of $x'$ and $t'$ it will still be a delta function and your instinct of using the identity $\delta(f(x))=\frac{1}{|f'(x_{\rm root})|}\delta(x-x_{\rm root})$, (where $x_{\rm root}$ is a root of $f$) is a good one. I.e. we will have $$ \begin{align} \delta\left(x-x_p(t)\right) &= \delta\left( f(x',t') \right), \end{align} $$ for some function $f(x',t')$. We will first want to find where this function is zero. Then we will find the derivative of this function with respect to $x'$ while holding $t'$ constant. We treat $t'$ as const because later you will want hold $t'$ constant and integrate the current density over all of space. The root of $f(x',t')$ will occur when $x'=x'_p(t')$, i.e. when $x'$ equals the x-coord of the particle in the primed frame at the time $t'$ (in the primed frame). This is true because the zero of your original delta function occurs at $x=x_p(t)$, i.e. when the event $(x,t)$ is coincident with the particle. And $(x',t')$ is the same event as $(x,t)$. Therefore, $$\delta\left(x-x_p(t)\right) = \frac{1}{|df/dx(x'_{\rm root})|} \delta\left(x'-x'_p(t')\right).$$ To get the derivative of $f$ wrt $x'$ holding $t'$ fixed, just rewrite $x$ and $t$ in terms of $x'$ and $t'$ as above: $$ \begin{align} f(x,t) &= x-x_p(t) \\ &= \gamma(x' + \beta t') - x_p\left( \gamma(t'+\beta x') \right). \end{align} $$ Remember $x_p(t)$ is just some function of $t$ that gives the trajectory of the particle in the unprimed frame. The deriv wrt $x'$ is $$ \begin{align} \left.\frac{\partial f}{\partial x'}\right|_{t'} &= \gamma - \frac{d x_p}{dt} \gamma\beta, \end{align} $$ where $dx_p/dt$ is the velocity of the particle in the unprimed frame at the time $t=\gamma(t' + \beta x')$. Therefore the result is $$ \delta\left( x - x_p(t)\right) = \frac{1}{\gamma\left(1-\frac{dx_p}{dt} \beta\right)} \delta\left(x' - x'_p(t')\right). $$ For your first transformation the particle was at rest in the unprimed frame so $dx_p/dt=0$ and the jacobian is just a simple $\gamma$ which is what your transformation was predicting. For your second transformation (from primed to double primed) take the above equation and increase every symbol's superscript by one prime. In the primed frame the particle is moving at a velocity $-\beta'$ so $dx'_p/dt'=-\beta'$ and the jacobian is no longer just a factor of $\gamma$. I'm hoping that when you write it all out this time everything will work out. Let us know :)