40mm is pretty thick...but my guess is that it could flex especially with torsion loads. Go ahead and bite the bullet and design a torsion box. I did and it was worth the extra effort. It's absolutely rigid and mine was constructed out of MDF. Even with 40mm, I'd double the thickness of the end supports for the gantry. They'll flex with the side loads of cutting in the X.