Amid unconfirmed local reports of overflights by American warplanes and the possible presence of U.S. military personnel in east Beirut, Shiite leader Nabih Berri warned today against U.S. "muscle-flexing" and threatened to withdraw from his role as mediator in attempts to win the release of 40 American hostages.

Another senior official of the Shiite Moslem militia Amal announced that all the captive Americans have been moved to new hideouts, some of them possibly outside Beirut, in order to thwart any rescue attempt.

Washington carefully denied a report by the Christian Phalangist radio that a squadron of carrier-based F14 jet fighters flew over Beirut and the Bekaa Valley early this morning, but Pentagon officials refused to make any further comment about the deployment and actions of U.S. military forces in the area.

Sources in Washington said three ships carrying 1,800 members of the 24th Marine amphibious unit linked up sometime Friday with a naval task force led by the nuclear-powered aircraft carrier USS Nimitz, United Press International reported.

The arrival of the helicopter carrier USS Saipan and two landing ships, the USS Nashville and the USS Spartanburg County, brought to seven the number of American naval vessels stationed off Lebanon.

The sources said the Marines were brought in as a "show of force," but there were no indications that they might be used in an attempt to rescue the hostages.

[A Pentagon spokesman, Lt. Cmdr. Charles Smith, would not confirm the report. "Even if it was true, I would be in a position not to confirm or deny," he said. "We are not talking about the operations or locations of any ships or aircraft.]

Berri, in an interview with reporters, warned as he has done before that any military action would be disastrous for the hostages.

"It seems there are American military preparations to embark on military action. There are reports about American air activity and the presence of American military personnel in the (Christian) eastern sector (of Beirut)."

But his threat to withdraw from the negotiations also appears related to growing unease among Amal leaders about the extent to which they will be held responsible if negotiations drag on or collapse.

Since the hijacking of TWA Flight 847 from Athens eight days ago Berri and his Amal forces have thrust themselves onto center stage in the crisis, claiming roles as the protectors of the hostages and the mediators for their release, but also apparently serving as the captors.

In the process, Berri and his militia also have become the most visible potential targets for any raids or reprisals. U.S. officials repeatedly have said they hold Berri responsible for the fate of the hostages. Thus even as Berri threatened today to give up the role of mediator if there is any U.S. military action here, he added that "whatever the target, we are ready" and that his troops would exercise their "right of self-defense."

Another senior Amal official, Politburo chief Akef Haidar, underscored these concerns at a press conference today when he suggested that President Reagan "made a mistake, a big mistake," when his administration suggested that Berri is responsible for the hijacking.

"Everybody knows Mr. Berri has a lot of enemies," Haidar said, mentioning the Israelis and the Christian Lebanese Forces. Haidar alluded to a car-bomb attack against another more radical Shiite leader in March that was linked to operatives who had been working with the U.S. Central Intelligence Agency in an attempt to develop a covert military option against precisely such forces as the hijackers of the TWA plane.

"Now if something happened to Mr. Berri, like the car bomb in Bir al Abed," Haidar said, "well, all the Shiites in the world will say the Americans are behind that, and no Americans in the Arab world will be safe after that."

"Mr. Reagan should thank Mr. Berri and not put the responsibility on his shoulders," he added.

Another senior Amal official said privately that the chaotic Thursday press conference with several hostages at the airport was a mistake because it gave the impression that Amal is in control.

Haidar, at the press conference today, sought several times to clarify the relationship between his organization and the hijackers.

"When the hijacking was done, we didn't know who did it or why," said Haidar. Berri did not grant the hijackers' request to talk to him until after they had killed one of the passengers, "and we saw it as our duty to come to the plane."

Now that the hostages have been taken off the Boeing 727 to a series of different hideouts, Haidar said, "we guarantee the safety of the hostages." He said Amal people can visit them, control where they are staying, how they live and what they eat. "So we can tell people they are in good health and a good position. Really, we are eyewitnesses to that."

But he added that "practically, the complete control is with the hijackers."

Referring to his assertion that the hostages had been moved, Haidar added: "Maybe later on they will be each with one family, some in Baalbek, some in the Bekaa -- let the American fleet come and look [for] them."

On the one hand, Amal openly endorses the hijackers' demand that Israel free 766 Shiite and other Arab captives in exchange for the American hostages. The Reagan administration has refused to ask Israel to do that, and Israel has said it must have a formal request.

On the other hand, as Haidar and other Amal officials now describe their relations with the hijackers, the only way they could compel the release of the hostages would be by using their own militiamen to free them by force. Haidar said Amal has no intention of doing that.

"I'm not ready to do any favor for the American administration," said Haidar. "Why? The American administration is doing nothing for us."

One key difference between the Amal leadership and the original hijackers, Amal officials suggest, is over the question of what to do with those hostages who are ill. One senior Amal official said privately that the hijackers refuse to release them one by one, and this is now "a major problem for Amal."

The three cases in question at the moment are Jimmy Dell Palmer, 48, of Little Rock, Ark., Claude Whitmoyer, of Severn, Md., and Simon Grossmayer, 57, of Algonquin, Ill.

Haidar said today that Palmer suffers from a heart condition but is receiving medication sent by his family and was given a check-up yesterday. He is "quite well," Haidar said.

Grossmayer, Haidar noted, "has cancer. He has been living with one lung for a long time. A doctor examined him, and he did not need a hospital. He is fine."

Asked about Whitmoyer, Haidar said, "Write down his name; I will send him a doctor."

There was earlier speculation that some passengers with Jewish-sounding names were not afforded the same protection by Amal as the other passengers, but Haidar said that they now were being treated like all the others and that their security is also guaranteed pending the outcome of negotiations.

"We are with the hijackers at all times in order to be sure that everything is okay," said Haidar. "They don't harm them as long as we are playing the role of mediator."

But, Haidar said, "if we don't succeed in our role we find ourselves in a fix. We say okay, thank you very much, and we will withdraw from this case, and we will not have control at all."

Having become, in this crisis, the representative of everyone and no one, Amal has "a kind of immediate presence," Haidar said. "We are there. We are looking. We are watching, and we know the hijackers are sincere. They have a noble cause."

Wire services also reported:

The crew of the TWA jetliner requested a doctor to board the plane and armed hijackers were seen searching the man's medical bag before he boarded, UPI reported.

The doctor, who wore a white coat, said one of the American crew members suffered a painful bee sting, Britain's Independent Television Network said.

ITN quoted the doctor as saying the hijackers and the crew members were getting along "quite well" and the atmosphere seemed friendly.

Reuter quoted another Amal source in Beirut as saying that several U.S. military personnel were taken off the plane shortly after a U.S. Navy man was killed by the hijackers. It is unclear whether the military men also still are being held separately, as has been reported in Washington.

Berri briefed U.N. envoy Jean-Claude Aime Saturday on the hijacking and the situation in Lebanon.

Berri told reporters later that Israel was shelling Shiite villages in southern Lebanon and rounding up "hundreds of new prisoners."

But in Tel Aviv, an Israeli military source said: "Israel is not shelling villages and has not arrested and is not arresting any more Shiites."

In Geneva, a government spokesman said Switzerland has contacted Israel on the hostages, its first such move since its offer to Berri to mediate two days ago. The spokesman said Swiss Foreign Minister Pierre Aubert had contacted Israeli officials concerning a telphone call from Berri, in which he said "he would be ready to bring the hostages to Swiss territory."