Indeed. And one of the reason EVs like Teslas and the Porsche Taycan corner so well even though they're incredibly heavy is also that their center of gravity is so low, due to the batteries being at the bottom of the car.
Low center of gravity is good, but no one would add dead weight just to lower the CoM. Stiffen up the springs and the lighter car is ahead by a lot.
[EDIT] Also, we've had boxer engines in race cars since at least the 40s.