Are you referring to the one on the pillar or the hatch? Does it pop off both sides or just off the loose one?
I went (am still going) through the same thing on the pillar.
If it's been loose for a while, the hole has wallowed out a bit and the ball head is no longer in proper alignment. When you open the hatch, the strut angle to the post becomes too great and pops off.
Of course, the retaining clips could be bent as well and not holding tight enough.
I removed both side trim pieces to determine what angle the post needed to be at, using the good side as a reference. Not having a welder, I used several short, sheet metal screws of different diameters to "wedge" the post into the hole at the right angle. Got a new strut and reversed it so the "fat end" snapped over the post.
I intended this to be a temp fix until I could either get it welded but it's held up fine for nearly 2 years now.