You asked

Which of the 400mm lenses keeps the widest aperture for dim sport?

The Canon RF 400mm f/2.8L IS USM keeps the widest aperture of the three, f/2.8. The Canon EF 400mm f/4 DO IS II USM is at f/4, and the Sony FE 400mm f/4.5 GM OSS is at f/4.5. On the aperture principle, f/2.8 lets in about a stop more light than f/4 and well over a stop more than f/4.5. In a dim gym or under floodlights, that buys you faster shutter speeds for moving athletes, so for dim sport the RF is the strongest choice here.

The other two still have a place. The Canon EF 400mm f/4 DO IS II USM gives up a stop of light for a lens that is presumably easier to carry, and the Sony FE 400mm f/4.5 GM OSS is, according to its page, about a kilogram and light enough to hand-hold. That makes it the pick for long days outdoors, where light is plentiful and you will be on your feet.

Image stabilisation steadies the camera, not the athlete, so it won't rescue a slow shutter speed in dim light. Aperture and the sensor matter more. All three lenses are for full-frame cameras, so pair any of them with a full-frame body. For the wider picture on reach and sensor choice, see reach. Long lenses also hold their value and change hands often, so a used copy can save a lot. Check each lens page for its current price.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.