Senior White House and State Department officials failed to grasp the Taliban’s steady advance on Afghanistan’s capital and resisted efforts by U.S. military leaders to prepare the evacuation of embassy personnel and Afghan allies weeks before Kabul’s fall, placing American troops ordered to carry out the withdrawal in greater danger, according to sworn testimony from multiple commanders involved in the operation.