And call me crazy, but I believe that whoever is best for the job gets the part, END of story.
You've never heard of a movie doing poorly because of bad casting? I'm not even talking identity politics. I am talking about movies were certain roles were so poorly casted that it ruined the movie. Jake Lloyd from the Phantom Menace is a prime example of this. Poor kid's life was ruined, and he ticks all the boxes that Anakin Skywalker should have. He's was a white, straight, male child. He was just a terrible actor (yes, even compared to other kids). Hayden Christensen was similarly criticized for the same role in later films of the prequel trilogy.
On the other end, we have movies that have been praised for fantastic casting. For me, that'd be something like The Brady Bunch Movie.
Either way, I don't believe at all that "whoever is best for the job gets the part, END of story". Otherwise, people wouldn't praise or condemn a movie for its casting. And I certainly doubt SJ won the part, because of merit. She was last year's most bankable female star because of the Avengers, but most other roles have led to flops, her acting has been mediocre at best, and a movie about a trans actor would likely have little box office impact from her Avengers success.