I think a better analogy might be where, after the bill passed, that member of Congress's election was invalidated for some reason. I think in that case, any Supreme Court would apply the de facto officer doctrine and hold that the law is valid, as other courts have done in similar challenges to laws by state legislatures. Any other result would be chaos. It would do the same with the vote of an elector if it was determined, after the fact, that the elector's appointment was invalid.
You’re right - that works better.