Well I messed around with it a bit today and I'm convinced that the part mounted on door frame (not sure what it is called) is not the right one. The door latches OK but I don't think that what it latches to set far enough towards the interior and that's what is holding it out.
I never really messed much with the body of the vehicles so I'm making my best guess.
What the latch hits (mounted on the frame) is called the striker. The bolts holding it on thread into nut plates (2 bolts per plate) that sandwich the frame around slotted holes to make adjustment in and out, and up and down possible. Loosen them and move the striker in the direction it needs to go and retighten. Check the fit and repeat as necessary. Check
here for specific instructions.