The Short Version
Available evidence supports the 40% figure for the period just before Kabul fell. The World Bank reported aid flows equal to 42.9% of GDP in 2020, and multiple 2021-era analyses described Afghanistan as receiving about 40–43% of GDP from foreign aid before the Taliban takeover. The main caveat is that aid fell sharply after August 2021, so this should be read as a pre-takeover snapshot, not a full-year average.