I have the same situation with mine all wires are good trunk locked changed latch twice mostly comes up when it feels like even while I'm driving I gotta slam the crap out of it to close but most times it just doesn't catch I'm about to just screw a lock set up on outside just to avoid this crap
Unplug the electrical connector on the trunk lid to verify it is not electrical as previously stated. If continues, you may need to adjust the striker hook that the lid latches down to. Else, you may need to replace the trunk latch.