The commerce clause doesn't say that a state cannot regulate anything that has ever traveled in interstate commerce. Rather, it does two things (as relevant here).
1. It prevents states from discriminating against out-of-state producers in favor of in-state producers. This is known as the "dormant commerce clause". So a state could not ban, say, the import of electric cars from out-of-state, while allowing in-state manufactures to produce and sell them them. But the state could completely ban the sale of electric cars within the state. The fact that someone wants to trade the cars in interstate commerce doesn't trump the state's right to regulate sales within its borders.
2. In certain areas where the federal government has enacted a comprehensive regulatory scheme under the interstate commerce clause such that it intends to fully "occupy the field" to the exclusion of any state regulation of the subject, the federal preemption doctrine does preempt any state laws. This might be closer to what you're thinking of. But it applies only in specific cases, where the federal government has actually explicitly preempted states' authority with a comprehensive regulatory scheme.