The solution of the apparent contradiction may be in the scales of time:
- At any point in time, you can either slim down (catabolic, during excercise) or build muscle (anabolic, during rest after excercise), but
- on a more coarse time scale where excercise and rest phases are "at the same time" both can happen "together".
See e.g. the paper cited in @SyrenBaran's answer reporting that this does actually happen.
Roughly speaking,
catabolism is the part of metabolism (i.e. biochemical pathways) that break down larger molecules into smaller ones, including the part of metabolism that produces free energy.
anabolism are biochemical pathways that produce larger molecules from smaller ones, using free energy.
By these definitions, β-Oxidation, the process that breaks down lipids (fat) into Acetyl-CoA that can then enter e.g. the citric acid cycle for energy production is catabolic, while producing e.g. muscle protein from amino acids is anabolic.
catabolic and anabolic pathways are almost always separate. This is required for energetic reasons [...]
Many metabolic reactions are regulated/controlled by the energetic status of the cell.
[...]
ATP-producing [catabolic] pathways are inhibited by high energy charge [that's a way to quantify the energetic status of the cell] whereas ATP-consuming [anabolic] pathways are stimulated.
(Stryer: Biochemie, Spektrum 1991, p. 338, my translation - if someone has access to the English version, feel free to replace)
So, if you look into a muscle cell during excercise, you'll find that mostly catabolic (energy "producing") pathways are "on" in order to rebuild the ATP that is consumed by the physical work, but anabolism (e.g. protein synthesis) is downregulated - that would be a further consumer of energy, which is scarce already. And the need for energy signaled throughout the body, upregulating e.g. β-Oxidation. So during excercise, you slim down but don't build muscle.
On a full body perspective, things get a bit more complicated: for example, you may be breaking down muscle protein into amino acids (catabolic) to have their liver use these amino acids for gluconeogenesis (anabolic) to produce glucose to feed the brain where the glucose enters glycolysis (catabolic). But, if we're looking at cycles of excercise vs. feeding & resting times, we can say that during excercise the metabolism is mostly catabolic, while anabolic pathways are active during feed & rest phases (there are still also catabolic pathways active: they produce the free energy and also substrates for the anabolic processes). See e.g. Rasmussen & Blake: Contractile and Nutritional Regulation of Human Muscle Growth, Exercise and Sport Sciences Reviews: July 2003 - Volume 31 - Issue 3 - p 127-131. They report increased muscle protein synthesis 2 h to up to 2 days after excercise - the review also contains time courses that show muscle protein synthesis ramping up after excercise.
At the first glance, protein metabolism seems to be unrelated to lipid metabolism. But protein is synthetized (anabolic) from amino acids, and these amino acids can also enter catabolic pathways for free energy production - and are then of course no longer available for protein synthesis. These pathways are coupled, and protein synthesis is downregulated when the more pressing need of the body is energy production. You may look at this as avoiding a futile cycle, at least if the energy need is sufficient that the body starts breaking down protein for energy production.
So the claim "you cannot slim down and build muscle at the same time" is correct in the sense that during excercise*, you can slim down but you don't build muscle. The actual building/growth of muscle happens during feed & rest phases - but only if your energy status is sufficient to not need the amino acids for energy production. I.e. when you don't slim down. The "window" to have the muscle grow and have the fat reserves grow less than what was used up during the excercise does exist, but it is not too wide. Hence the posts that @Fattie links in their answer that emphasize that this will happen only under carefully adjusted conditions.
So as net effect over several excercise and feed & rest cycles (the claim in the question looks at weeks), it is possible to slim down and build muscle.
* the so-called anabolic excercises have a net muscle growth only over longer excercise plus rest phase cycles. During these excercises, biochemical state is nevertheless catabolic. "Anabolic excercise" IMHO belongs into the same category of terms that calls a lemon an "alkaline food".