The Reagan administration suffered a major foreign aid setback last night when the Senate Foreign Relations Committee, voting 9 to 8, transformed the president's Caribbean Basin Initiative into a multilateral program to be run by the World Bank.

The turnabout shocked administration officials and committee Chairman Charles H. Percy (R-Ill.), who late in the evening was attempting to arrange a reconsideration of the amendment, which radically redrafted President Reagan's plan to aid Central American countries.

The Reagan plan had been presented as a bilateral aid program in which the United States would send $350 million this year to several Central American countries, including $128 million to El Salvador.

It was a pet project for the White House. Percy told the committee that Reagan called him yesterday morning insisting that the measure was "urgent."

Sen. Christopher J. Dodd (D-Conn.) introduced the critical amendment, changing it from a bilateral program to a "trust fund" operated by the World Bank. Dodd argued that this would make other countries more interested in participating as donors.

At first Dodd was beaten on a tentative vote of 8 to 6, but when the committee regrouped his amendment carried by one vote. Sen. Charles McC. Mathias Jr. (R-Md.), who had reached agreement on an amendment he favored, provided the key switch vote.

The bill went through final passage before Percy made an attempt to reconsider the entire package in an apparent attempt to restore the bill to its original form. He contended that Mathias had misunderstood the impact of Dodd's amendment.

In a testy exchange with Percy, Dodd said reconsidering the measure would amount to "aborting the system" by which the committee votes. "I know what's happened and I don't like it," Dodd told the chairman. "We debated this for a long time."

Percy claimed there had been an "honest misunderstanding," and insisted that the committee should reopen the entire bill, which was passed 16 to 1. Administration officials said they would attempt to restore the original on the Senate floor if the reconsideration move failed.

The administration had promoted the Caribbean Basin measure vigorously on Capitol Hill for months, arguing that it was necessary to give immediate aid to hard-pressed Central American countries.

With more than one-third of the money destined for El Salvador, critics contended that the measure was a cover for pumping more money into a country the administration considers a key to stopping communism in Latin America.

Last night's turnabout was especially dramatic because the administration consistently has sought to reduce the amount of foreign aid funds passing through such multilateral organizations as the World Bank. It favors direct bilateral aid controlled from Washington.

Percy, strenuously opposing Dodd's amendment, contended that the $350 million is urgently needed because some Central American governments "are in danger of falling overnight." Creating a new international bureaucracy to manage the fund would delay its start until at least 1984, he said.

Dodd had won Mathias over by agreeing to support his amendment, which provides that some of the local currency generated would be used exclusively by non-governmental organizations.

However, under the final version, with all monies to be administered by a multilateral organization, there was no assurance that any local currency would be generated. Mathias had been under a "misunderstanding" on that point when he voted for Dodd's amendment, Percy contended.