Dozens of companies borrowed record sums in investment-grade bond markets last week, after the Federal Reserve helped provide market stability. But it wasn’t the companies hit hardest by coronavirus.

Nearly 50 companies tapped markets to raise $109 billion last week, the highest ever. About $63 billion of that came in the first half of the week, just as investors were withdrawing record amounts of cash from bond funds: There were $38 billion of outflows from investment-grade corporate bond funds in the week ended March 25,...