I haven't really thought about local vs global rigidity. Thanks for that idea.
I did some quick simulation in F360 to see what will happen if I used angle iron vs tubing. The results confirm what you said. I didn't cap the ends to exaggerate the deformation. I think I'll go with 10mm thick angle iron with capped ends (10mm is enough for tapping holes in the ends for m5-m6 screws so I don't have to weld the caps). And a big bonus is that angle iron is a lot easier to work with in this situation.
For simulation I used 2000N of side force (along the X axis). 2000N in Y direction didn't show any noticeable deflection in the side risers, it was mostly in the gantry tube.
I'm getting a bit worried about the ever increasing weight. As it stands now, the gantry without the Z axis weighs 70kg/150lbs. I thought about using dual Nema34 9Nm motors in a 2:1 belt reduction setup to have at least 10 meters/m and without going over 500-600rpm. But whatever... I'll design for stiffness and worry about the drive part later.