The idea is the courts look to Congress on what is constitutional and they follow its rulings. A court could only declare a law ultra vires that is, a law that makes something not delegated to Congress by the Constitution. Have you read Marbury v. Madison? The plaintiff asked for a remedy that Congress passed, that the Constitution forbid. ANd you say the court is then, faced with that, to choose Congress?
The law may be questionable, it may be in error but unless it exceeds its proper limits, the question of whether the remedy is just is NOT for the courts to decide. It is up to Congress to decide if the law ought to be changed.
(Denny Crane: "Sometimes you can only look for answers from God and failing that... and Fox News".)