A shower door has closing problems just like any door. Sometimes they don’t close very well, whether from abuse or time. Swinging shower doors will occasionally need to be adjusted.
Open the shower door and lift it upward slightly. See if you can determine if there is any “play” in the door and if so, where the cause of it is. Usually, swinging shower doors are connected to a channel that gets screwed onto the shower enclosure from the inside of the shower. It may be that the door and channel are loose at a screw. If that is the case, Lift the door to its normal position and tighten the screws that hold the channel in place.
It may also be that the vertical support that the channel is attached to is loose. Check at the top of this hinge to see if there is any movement in these pieces. There shouldn’t be, but if there is you may have to get creative.
Also check the shower sweep at the bottom of the door. In a lot of cases, the sweep will become warped and/or loose and fall down somewhat. When it drops, the door won’t close without some effort. I would replace the sweep if that is the cause.