Let's look at this one again:
Here's why it works:
Longitudinal flex (front to back, as in the frame bending vertically in the middle), is handled by the vertical posts in the rear flexing forward or back. Notice there's no longitudinal triangulation on those posts so they're free to flex front to back.
Lateral flex (side-to-side) is handled by the vertical posts in the back flexing side to side, as well as the rack itself flexing side to side. The front of the rack is rigidly attached to the cab (6 points) and there's at least 6 feet between the rearmost cab attachment and the back, so there's plenty of distance for a properly designed rack to flex. And with no lateral triangulation on the posts, they're free to flex side to side.
Radial flex is handled in a similar way to lateral flex, the rear posts flex and the rack twists.
Designing the proper amount of rigidity vs. flex into the rack is a solvable engineering problem and in any case the rack will be more flexible than the heavy and well reinforced frame. Especially since this rack appears to be aluminum, which in general flexes more than steel.
A similar design could work on the Gladiator but as I said I'd tie the front of the rack to the roll bars instead of using drip rail mounts on the fiberglass drip rails.