Well given that 50mm square 10g (3mm wall) box section is stiffer than the 40 x 30 x 3 I postulated this should be plenty stiff enough for your needs...

That calculation assumes rigid corner joints and a cross member at each end between the Y-rails of the same stiffness.

The other racking issue is where the cutting forces cause the non-driven upright to rotate in the vertical plane relative to the driven one. Obviously gets worse as the cutter rises above the table, so you need to ensure torsional stiffness of the gantry in the Y-Z plane.