The judge cited an unratified UN guidance document, as I understand it. Your position is not without merit, but at the very least a precedent that only SCOTUS can rule on this subject.
He did cite a UN compact, but he also cited US law. However, Rush pointed out that law conflicts with the law that gives the President powers over immigration to refuse admission to any group he deems necessary.
And apparently Trump cited the SCOTUS backing of that second law in his executive order.
So with two contradictory laws. I’m betting that SCOTUS will side with the President, especially if the law about Presidential powers was the latest passed (which I’m not sure of).