I’m guessing people will be stockpiling them. Used ICEs will probably retain lots of value for years after this mandate goes into effect. Especially when people figure out the electrical to their home doesn’t have enough to charge reliably.
For a short time. However soon after they will discover that an ICE doesn't take to just sitting around for years. Not used seals start leaking. Lead-acid batteries need to be stored correctly or they discharge and fail. And other problems - all for a car that you don't use, and fuel is hard to find.
There will be a few niches that still use ICEs (but my guess is they get the law changed and one factory in the world provides all the vehicles that niche needs - this won't be the average car, but something setup for their niche, so they won't be interested in your stored car)
Cuban's still use cars from the 1950s. An entire ecosystem springs up around it. I don't think it will be a big deal. Eventually they will phase out except for wealthy people and collectors (sort of like horses today) but I have to imagine they will be pretty common for the next 15-20 years after the ban. I expect a lot of people to buy them leading up to the ban as well.