In 1985, Coca-Cola research showed people actually preferred the flavor of Pepsi, so they made a taste-tested Pepsi clone. It was launched as New Coke, and despite people preferring New Coke in blind taste tests, they still wanted to buy and drink Coca-Cola Classic. New Coke was a massive flop.
So even if Pepsi managed to make a perfect Coca-Cola recipe clone, they're missing the main ingredient - their brand.