I’d do your building in phases. Fast to cut fat and workout to maintain muscle for phase one. Then eat fairly low carb but high protein/fat at a caloric surplus to fuel protein synthesis and build lean muscle in phase 2.
As has already been stated, fasting is almost magical for stripping off body fat, but despite HGH spikes protecting your lean mass I wouldn’t expect much in the way of mass gains. Better to work with your body and add mass while eating at a surplus, and strip off fat while fasting and running a significant deficit.