VERY SMART POLITICAL MOVE
It's a win/win/win move no matter what happens.
Trump is going to make Leftists argue in favor of 'gun rights'. The Leftists are going to try and shift the argument to one of "let's just ban guns for everyone..that'll be fair", but it won't work...they'll HAVE TO argue that those with gender dysphoria can't be denied 'their rights' blah blah blah..
Even if SCOTUS overturns Trump, Trump would have the Leftist judges on record. And Trump would have the 'don't blame me' political talking point.
Even if SCOTUS upholds Trump's order....it's obviously a win for denying "rights" never intended for groups that shouldn't be amongst us in the first place.
There is no political downside for Trump doing this. It's 'painting The Left into a corner'.