Patient to doctor while demonstrating, "my shoulder hurts when I lift my arm like this".
Doctor to patient, "well, stop lifting your arm like that".
It' an old joke, but very apt in your situation. Shifting the front under load will cause chain drop. That's because you usually do so when on the inner half of the cassette, and the chain is coming to the chainring at an angle. As soon as the chain disengages from the larger ring, the tension makes it snap inward like a rubber band, and overshooting the smaller ring.
There are fixes as Hillrider noted, and they do help, but the right fix is to not shift under load in the first place. Anticipate your needs and when starting a climb, downshift the front soon in the sequence while your pedal cadence is still high, and the load lower. This also has the advantage of shifting while the chain is feeding straighter, so that "rubber band" snapping is reduced.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.