I think they revealed Annette Bening's character too soon though. They already said early on in the movie she was Wendy Lawson. So anyone who knows would immediately know that she's a female version of Walter Lawson and probably Mar-Vell. That immediately made Jude Law probably Yon-Rogg.
And for the general audience, those names would've been meaningless, so there would've been no twist at all.
If they were going this route, then I think they should've set up Law as Lawson and Mar-Vell, and only later on revealed that in fact he was just pretending to be him, and that Annette Bening was actually Mar-Vell. That would've been more of a twist for everyone. Otherwise it's not really a twist, but you know immediately it's just a gender swap like Jonathan Higgins to Juliet Higgins on Magnum PI, or Kono from a male to a female on Hawaii Five-O. And it's nothing at all to the general audience who weren't expecting Law to be anyone or who don't know about Mar-Vell from the comics.