Gluten free is the new diet scam, his nutritionist is BSing him. There are NO benefits to eating gluten free unless you have celiac disease, and in fact eating gluten free can actually cheat you out of the nutrition that you need. It doesn't help anyone lose weight.
If you want to lose weight it won't matter how many calories you eat, if you burn more than you consume you will lose body fat. It's that simple. So that's what he is doing. And laying off fatty foods too evidently.
When Phelps trained for the Olympics he would consume nearly 10,000 calories a day. And to replenish he would drink chocolate milk. If you or I did that we would blow up like a balloon, but he burned it off.
So this diet isn't what is causing the weight loss. In fact it's simply providing the extra fuel for him to work hard to burn calories. I'm actually a little bit surprised he was only eating 2700 calories a day. That's not excessive for someone who is working out daily, which makes me thing that he was either eating more than that and was eating a lot of fat and empty calories or he was eating that many calories and not working out very much.