The U.S. Supreme Court has upheld the constitutionality of federal and state retroactive tax legislation on several occasions throughout the years. In its most recent decision concerning retroactive taxation, the Court upheld the retroactive application of an amendment limiting a federal estate tax deduction on the grounds that it was not harsh or arbitrary and did not have an unduly long period of retroactivity (U.S. v. Carlton, 512 U.S. 26 (1994)). In 1938, the Court upheld a Wisconsin law that retroactively disallowed an income tax deduction for certain dividend payments, rejecting arguments that the retroactivity violated the appellant's equal protection and due process rights (Welch v. Henry, 305 U.S. 134 (1938)).
You are absolutely right. The only exception or out will be whether the retroactive snare would be construed to be double taxation (redundant) to the IRA penalty clause already in IRS rules. If this was tried it would invoke the mother of all class action suits.