Creating a significant caloric deficit — through fasting, time-restricted eating, or any other method — almost inevitably leads to muscle loss. The mitigation strategy is hitting 1g of protein per pound of body weight and maintaining resistance training, but even that won't fully prevent loss during aggressive deficits.