It was the most significant blow yet to the efforts by Trump and top adviser Elon Musk to drastically shrink the government.