Youre wrong, its an excellent legal argument. The original court decision was ridiculous, but it IS legal precedent that Trump can well use, if he wants.
There is a world of difference between “it is an argument Trump could use in court” and any basis in legislated or adjudicated law.