chains can sometimes drop off the outside due to mis-alignment of the front der. cage... if the cage is even the least bit mis-aligned to the chainrings, it can cause the derail when shifting....
i watched a worn derailleur's cage momentarily twist out of alignment DURING shifting... not saying your der. is worn or loose, just adding that info to the thread.
that derailleur is now on it's way to being a brand new dryer, or computer case, or maybe a trash can..
i've also seen a heavily molested and badly bent up ft. der that would swing from "tail in" to "tail out" when shifted... it too has been recycled. the customer kept trying to get me to waste an hour or more trying to straighten it out.. then i told him my hourly labor rate as i laid a $5 replacement in front of him.. he opted for the used part.

the "symptom" of that bike was...chronic overshifting in both directions....