The cake collapsed because of the rapid change in temperature. You can't take the cake out immediately after baking it, you should put it in the oven to warm up slowly, and then take it out after slowly adapting to the outside temperature.
After the cake comes out of the oven, you need to give it a slight shake to get rid of the excess gas in the cake. (If you don't do this, the cake will collapse after it comes out of the oven because the temperature outside is lower than inside the oven, and the gas inside the cake will expand and contract, causing the cake to collapse.)
Notes
1. Stir the batter out of the gluten.
Wrong way: Stirring the batter for too long and with too much force causes gluten to come out, resulting in collapse.
The right way to do it: just mix the batter until it is smooth.
2. Unmolding without cooling thoroughly.
Wrong way: Release the mold too quickly, the cake body is not completely cooled, and the internal structure of the cake body is not stable, causing it to collapse when it is released from the mold.
The right way to do it: Remove the cake from the oven and allow it to cool to room temperature before unmolding.