One of the biggest problems people have when making macarons is the "macaronage"' which is basically the folding in of the dry ingredients into the egg whites.
If the batter is over mixed, it becomes to runny, and then the cookie will loose its shape, and be all wonky
All descriptions say "stop mixing when it looks like flowing lava". Liked we've all seen that.
You don't necessarily need to be gentle with the batter, because it is mixed to get some of the air out. So, fold some, then check how it flows off the spatula. It should sit on itself for a few seconds then smooth out when it's ready.
Also, I've found to not over fill the pastry bag. All the squeezing is still working the batter, and when you get close to the last in the bag, it will be much looser than at the beginning. If I don't watch that, the last ones piped will be duds.
Unfortunately, to learn how these cookies work, you generally waste almond flour (grrrr!). I hate it when they flop, and with as many as I've made over the years, it still happens. Just keep trying, watch some videos, read lots of tutorials. It will all help.