CA has been doing that since the 80s. It used to be cars were labeled as CA-compliant or 50-state compliant for emissions. Those that did not meet CA's regulations could not be registered there.
And yes, even vehicles that meet the standard for when they were manufactured are being forced off CA roads. I have in-laws there who have to sell perfectly good diesel trucks because they don't meet current standards. Even though they meet the standards that were in place when they were originally sold. They have to be sold out of state.
There is a difference between a car that doesn’t meet a mechanical standard and a car whose purchase would result in the state falling short of a 7% electric goal. But obviously the courts take a “government uber alles” approach. I just don’t understand how it can be legal. But I guess I don’t see how much of our current government is constitutional!