The upshot of this is that women with a genetic advantage are banned, but men with a genetic advantage aren't; is this not straightforwardly sex discrimination?

No. Nobody is banned from the "men's" category, including unambiguously cisgender women of completely unambiguous sexual characteristics. They just wouldn't stand a chance, practically speaking (for example, in the 100 metre sprint, the all-time women's world record time would not meet the qualification standard). There was already "sex discrimination" in the fact of the women's category existing in the first place; this was done as a pragmatic matter so that the world has the opportunity to celebrate peak female physical achievements.

The debate is really around how the handling of intersex and transgender athletes intersects with the original purpose of creating a separate category for women.

>Nobody is banned from the "men's" category, including unambiguously cisgender women of completely unambiguous sexual characteristics.

This is exactly my point. Men with unusual characteristics are celebrated, but women with unusual characteristics are excluded into a non-competitive category.

You can justify it if you'd like, but in a practical sense, no man will ever get to the Olympics only to be turned away because they don't genetically qualify for competition. This is an indignity reserved only for women.