Ours does the same. I am not sure what fridge you have but we have a ‘lock’ rotating disc on the top. It works to a degree.
One thing I did notice was that the door is held in place by metal hinge pins in the fridge frame top and bottom. These pins go into the plastic door frame, a raised plastic discs molded into that plastic frame holds the door up slightly, leaving a gap at the bottom for the door to open.
This plastic bit molded into the door cracks around the edge, probably under the weight of the door. This plastic bit then bends inside the door frame, the door drops a few millimetres and now the top door catch no longer catches.
I need to fix mine, replacing the plastic disc with a metal strip with a hole drilled in it, screwed to the bottom edge of the fridge door. Should be stronger and be able to take the weight of the door.
2007 Dodge 3500
[5.9 Cummins, Stick Shift] + [XPCamper V1E]