It's notoriously hard to lose fat without also losing muscle. That's why bodybuilders bulk well past their target muscle mass before they cut for competition. I agree that you can do a lot to mitigate it through protein intake and resistance training, but you'll almost certainly still lose muscle when you're in caloric deficit, regardless.
I don’t mean to be rude but there are worlds of difference between your average SAD-fed 300lb person going from 60% to 30% bodyfat and a 259lb bodybuilder going from 20% to 5%. As long as you are minimally reasonable, catabolism is a luxury problem.
I'm not sure why this is so heavily downvoted. You raise some good points. I would add: The era of comical bulking is coming to an end. More and more scientific literature points to modest calorie surplus is the key to muscle gain (along with regular weight training).
Furthermore, this effect is dependent on genetics. What is no problem for one guy in the comment thread could be very challenging for another.
Also, "just do proper resistance training" is a bit of a stretch when we're talking about what is practical to expect of the masses taking Ozempic.