because while I was restricting, I was also exercising quite a bit daily  You are not a plant. Your body can't manufacture tissue from carbon dioxide, water, and sunlight. If you are not eating enough to build muscle, your body will not build muscle, and nothing can change that. At best, exercise can affect the fat/muscle ratio of your weight loss, but you will never lose zero muscle while restricting.