Yes, adding tomatoes too early can significantly hinder onion caramelization. The acidity of the tomatoes prevents the Maillard reaction, which is essential for browning and developing the sweet, complex flavors of caramelized onions.
Caramelization is a non-enzymatic browning process that occurs when sugars are heated. Onions, naturally containing sugars, undergo this process when cooked slowly over low heat. The Maillard reaction, a chemical reaction between amino acids and reducing sugars, is also crucial for developing the characteristic color and flavor of caramelized onions. This reaction is most effective in a slightly alkaline environment. Tomatoes, being acidic, lower the pH of the cooking environment. This acidic environment inhibits both the Maillard reaction and the breakdown of sugars necessary for proper caramelization. As a result, the onions will take much longer to brown, may not develop the desired sweetness, and can end up stewing instead of caramelizing. To properly caramelize onions when using tomatoes, caramelize the onions fully first, then add the tomatoes later in the cooking process.
If you must add tomatoes early, consider adding a pinch of baking soda (sodium bicarbonate) to the onions. Baking soda is alkaline and will help neutralize the acidity from the tomatoes, promoting better caramelization. Be careful not to add too much, as it can affect the flavor and texture.