Anyone, Trump included, had to know this would be struck down. I know people were upset to see Trump institute the ban after the Vegas shooting, but what it did was get a major infringement case in front of SCOTUS. In the end, a good result, whether accidental or by 4-D chess.
So, it seems that Congress can throw up roadblocks to ownership as long as a law-abiding citizen can eventually own a regulated gun or gun accessory.
I can own a Tommy Gun if I want to, but I need a lot of paperwork and patience.
My thought was it was gun control, it affected the least number of people, Trump went about it ham handed, knowing (hoping) it would be struck down. Then he could shrug, smile and say, “Well, we tried” to the grabbers.