The locks jumping up and down is a classic sign that the door latch microswitches are faulty/on the way out.
If it's had a bit of a hissy fit, then you will now need to enter the EKA code to get it running again. Classic sign of needing the EKA is having the other doors all locked except the drivers door, as that will unlock manually with the key. As long as the CDL switch is working properly, then the tailgate will lock/unlock as it uses the CDL microswitch as a ground for the unlocking motor in the tailgate.
I would check that the replacement latch you have fitted is 100% working with the microswtiches... I had one just this last weekend that was locked out, wouldn't start, EKA wouldn't enter properly in the drivers door. I was expecting to have to pull the BECM and hook it up to the faultmate and reset it, but luckily it wasn't locked down that far, and it was recoverable with my Nanocom. I diagnosed that the door latch had a faulty Door Ajar switch, AND faulty key switch - so even though it was showing up as being locked/unlocked properly, the BECM wasn't detecting that the key was being turned in the lock. This stopped it from being possible to enter EKA in the door, sync the keys etc.
He brought it to me yesterday, and I fitted a recon door latch, and everything now works as it should, including being able to resync the fobs.
Moral of the story... door latches seem to cause probably 60% of locking/EKA issues I see on P38's. The next biggest chunk is from batteries going flat whilst the vehicle is locked/alarmed.