Cooking a cake overnight in an electric oven can potentially have negative consequences and may cause damage to the oven. Here are a few reasons why it's not advisable:
Overheating: Most cake recipes are designed to be baked for a specific amount of time at a particular temperature. Leaving the cake in the oven for an extended period, such as overnight, can cause it to overheat. Prolonged exposure to high temperatures can damage the heating elements and other components of the oven.
Drying out: Cakes are meant to be baked until they reach the appropriate level of doneness. Leaving a cake in the oven for too long, especially overnight, can result in an overly dry or burnt cake, as the extended baking time can remove too much moisture from the batter.
Fire hazard: Leaving an oven unattended for an extended period, particularly overnight, increases the risk of fire. It's always important to monitor the oven while it's in use to ensure safety and prevent any potential hazards.
It is recommended to follow the instructions provided in the cake recipe and use the recommended baking time and temperature. If you need to leave the house or attend to other tasks, it's best to turn off the oven and resume baking later when you can properly monitor the process.