True, a legislature cannot legislate 'ex-post facto,' however, SCOTUS can make it clear in their decision what path a legislature may follow going forward, to legally circumvent the 'will of the people' by exercising their authority as elected representatives of the people. It will be perfectly legal for the 'several States' to decide who those electors will be, under constitutional instructions.
Ironically, this may be another case of Republicans getting what they wished for and then regretting it. They had no plan to 'replace' the ACA, only to repeal it. Likewise, they were caught flat-footed in the backlash when SCOTUS overturned Roe. If SCOUTS hand Reps the constitutional tools to commandeer the Electoral College, that might just be the end of the EC and, the beginnings of a constitutional amendment for the popular vote election of POTUS.