What you need to do is to examine the top of the doors with the rollers. There is an adjustment where you can lower the door or raise the door. seems that your door needs to be lowered so that it stays in or on the tracks.
Then if it is not adjustable, then shim down the upper track. Unscrew some of the screws and insert some shims there to lower the track. You may need to use longer screws for a good fasten.