During a night attack your defenses was demolished. The defense is restored automatically. But at that moment you have built the fleet and the restoration of defense automatically got in line. It just has not had time to recover before the next attack. You can adjust the sequence of buildings manually. Hangar construction can increase the volume of the FAS. It is not a bug