EV cars use more rare elements that require more mining is true. So one would assume that the initial CO2 generated in the productions to be higher.
The grid isn't 100% renewable so there is plenty of co2 produced in running an EV.
EV batteries wear out around 100000 miles, requiring a costly(both $$ and CO2 production) replacement. Meanwhile ICE cars today can regularly approach 200000 miles before replacement.
With those three things considered, I highly doubt that CO2 production is impacted all that strongly by switching to an EV.