The door rests on the stops (on the inside) which transfer 100% of the pressurization load (from the inside out) into the fuselage. The stops look to be welded or part of the structure. There is no need to prevent movement inward because the force under pressurization is in the opposite direction! This door is apparently a 20 year old design, used on the legacy pre-MAX 737, it was not conceived by idiots.
The bolts don't carry this load at all. Their purpose is to keep the door from sliding upwards vertically up and over the stops.
The operation of the door for maintenance e.g. like opening a window for ventilation, the bolts are removed, the door is then lifted upwards with the help of springs, sliding past the stops and pops out. There looks to be a small strap to help keep it propped open.
Likely the presence of any one of the four bolts that restricts vertical movement would have prevented this, at least until it was discovered at a maintenance checkup.
It's possible the door was sitting on the stops with no bolts and enough landings happened inducing vertical loads to cause it to gradually slip out of place. Similar to how you can hold a mattress on top of your car with friction and your hand for a period of time, it just takes one gust of wind in the right direction and the rest is history.