The tailgate handle on my Frontier messed up on Sunday. It behaved as if it was locked regardless of the key position. I took off the access plate and heard something drop into the tailgate. There's a yellow arrow pointing to a pin that keeps the mechanism that slides when the lock is turned from flopping down, and that's what broke on my handle. So I ordered a new aftermarket handle assembly off of eBay for about $40, and installed it.
After installing it, I found that the handle still wouldn't catch about half the time when it was unlocked. The sliding mechanism was sliding on top of the other metal part on the left that twists to pull the two latch rods, rather than fitting in to the groove. What I finally figured out was that the metal part that's highlighted with the red arrow has to push somewhat tightly down on the slider to keep it in place. Not so tight that it binds, but tight enough to keep it from flopping around. With the correct tension, it works right every time - at least so far
Hopefully this will help someone down the road.