The most common cause of a dense gooey cake is overmixing. And the over mixing is usually caused from incorrectly creaming butter and sugar. All recipes are wrong in instructing to use room temperature butter to cream butter and sugar. In culinary schools they teach you to cream butter at 65°F not room temperature. I don’t know why recipes and cookbooks others instruct home bakers to use room temperature butter. To be honest I use butter cold out of the refrigerator. And I have done it this way for nearly 20 years. You just need to know what your butter is supposed to look like as your creaming it. And the video link below will explain it to you.
The reason that you need to use cold butter is creaming butter and sugar is not about mixing the two ingredients, rather it is what we call mechanical leavening. The sugar crystals cut through the butter. When the butter is cold it will hold the shape of those air pockets crates by the sugar. The leavening is activated by the water and acids in the batter it will create CO2 The gases will then begin to fill up in those air pockets in the butter.
But if the butter is too warm, the melts too soon, and the air pockets collapse before the leavening has a chance to fully activate to fill them. So you end up with a dense gooey cake.
The melting temperature of butter is about 90°. Room temperature butter maybe anywhere from 72°F to 75°F. Beating causes friction. Friction causes heat. By the time you finish beating that butter it’s about 85°F. The butter in the batter into melting way too fast in the oven.
If you are going to bake on a regular basis I would encourage you to buy an instant read thermometer. Take the temperature of all your ingredients. And think of temperature as an ingredient. Making is all science. It’s a chemical reaction of all the ingredients. You mix in the flour, the eggs, and the milk. But you don’t have cake until you add in temperature. And temperature comes in at different times and in different amounts: temperature of the ingredients before you start mixing: friction temperature gets added in during the mixing; thermal temperature gets blasted in the oven; and reduction of temperature in the cooling to set your cake. Temperature is such a vital ingredient in all of baking.
The link below explains the correct way to cream butter and sugar.
Just an aside, there are other causes such as too much liquid in the batter, too much sugar in the batter, incorrect oven temperature. But I do not believe those are the causes because the first time you made the cake it turned out fine. That leads me to believe that it is the buyer temperature and the creaming of the butter and sugar.
Good luck hope your next cake turns out better. Happy baking
https://www.seriouseats.com/2015/12/cookie-science-creaming-butter-sugar.html