Electric vehicles cause much more CO2 emissions during production as compared to cars with internal combustion engines due to complicated manufacturing process of the battery.
If you’re comparing CO2 emissions, you have to consider the full lifecycle.