This usually happens if the ingredient ratios are off or if too much raising agents have been added. The cupcakes rise super fast and then sink. Be sure to follow the ingredient quantities closely to prevent this. Vegan cupcakes can also sink if the oven door was opened during baking. Opening the door can change the oven temperature up to 150°F or more (The Kitchn) Do not open the door before the first 20 minutes of baking and you'll be good.