I know you asked about Z axis, but I would not use that design for the gantry sides. That I-beam is very weak when used like that and it will just twist the flange for loads in the Y direction.

I would plate over at least one of the sides to create a box section. You could do this by extending the existing end plate on the end of the main beam so it reaches the bottom of the I beam (lower flange) and joining them.

I-beams can be used for the gantry sides but they need to be orientated so that the flanges are pointing up/down (not fore/aft) and the central web runs inside to outside.

So in top view it would look like this:
|-|