Vainly waiting for a diplomatic solution, President Carter missed the most opportune time for launching the hostage rescue mission to Iran, and thereby increased the risk of failure, according to government sources.

About last December, military planners from the Joint Chiefs of Staff warned the president that, if he was going to launch a secret raid, he should do so within about 90 days -- before the end of March.

By April or before, they warned, desert sandstorms would howl across the Iranian back-country, greatly complicating the long-distance logistics of the raid and lengthening odds against success

When the mission was aborted 10 days ago, a raging late-April sandstorm in the southern desert of Iran was a principal component of the failure. It forced one helicopter to retreat to the Nimitz aircraft carrier in the Gulf of Oman, grounded another one temporarily in the desert and may have contributed to the breakdowns. The mission was scrubbed for want of enough helicopters.

This question of high-risk timing is one of many elements, disclosed by those with inside knowledge, which suggest an understanding of the mission plan that is quite different from that suggested by President Carter and his top military advisers, Secretary of defense Harold Brown and Gen. David C. Jones, chairman of the Joint Chiefs.

The president and his officials have portrayed the mission as "snake bit" by bad luck and random technological failures, but they insist that the original plan had "good" to "excellent" prospects for success.

To some planners, however, it always looked like a high-risk operation. Indeed, in corroborating details now filtering out, the picture is clear: preparations were made anticipating the possibility of extensive casualties, including perhaps some of the hostages who were to be rescued.

This, in turn, underscores a fundamental change in President Carter's thinking about the long-running crisis. For six months, Carter said again and again that his main purpose wast to save the 53 American captives in Tehran. But in launching the desert mission, he concluded that another objective had taken precedence -- ending the crisis, once and for all.

Carter, said one administration official, wanted "to lance the boil," even if the outcome fell short of his original goal of rescuing all the hostages in good condition.

"A cancer that has to be removed," according to one adviser.

In face, at one point the going estimate inside Pentagon and administration councils for a successful mission was as low as one in four, or 25 percent, sources said.

Glen. Jones came close to acknowledging this last week when he said at a Pentagon press conference that "in the initial stages we did not see an option that had a reasonable chance of success.

"After improvements, some in use of technology, exercises, concepts -- we came to the conclusion that it was militarily feasible, and all of the Joint Chiefs of Staff -- we collectively addressed this -- concluded that we had a good chance of success. There were some risks, yes . . . "

Jones and others have steadfastly declined to specify the degree of risk, but one part of the operation that has not been disclosed before suggests heavy casualties were considered a definite possibilty.

Besides the C130 transports waiting for rescue helicopters in a secret escape base west of Tehran, sources revealed, the plan called for having giant C141 transports on call in case there were too many dead and wounded to fit inside the two C130s. The casualties would have been flown to a hospital in Egypt, presumably in Cairo.

Although this fits under prudent worst-case planning, the inclusion of the C141s throws new light on Secretary Brown's April 25 assertion that, once the Blue Light commando unit reached the embassy itself, this "was the part of the mission of which they were most confident." Brown said he and the Joint Chiefs had focused on the embassy takeover part of the plan before recommending the mission to Carter.

The apparent reason Carter, Brown and Jones put so much confidence in a plan considered risky by some other insiders was their conviction that the assault force could be called back quickly at almost any "fail-safe" point along the way and that the embassy could be taken by surprise, according to sources.

Brown suggested as much last week when he said "the plan provided for the possibility of terminating the operation because of any difficulties, such as mechanical failure or detection by the Iranians of the mission."

Yesterday sources disclosed that an elaborate recall network had been established in Iran, with superb communications linking it all together.

For example, sources said, the 50 to 100 "friendlies" infiltrated into Iran in advance of the rescue attempt were ordered to spread themselves out all along the advance route from the Blue Light teams mountain hideaway east of Tehran to the embassy compound itself. The friendlies included U.S. military specialists and intelligence operatives.

As the commandos approached the city in innocent-looking trucks and buses mixed in with the night traffic, the friendlies were supposed to keep track of them and Iranian security forces every step of the way.

At the first sign that the cover of the mission had been blown, the Blue Light commanders would learn about it from friendlies plugged into the elaborate warning system. Then the commanders would have the option of calling everything off.

If the 90 Blue Light commandos reached Tehran undetected, they would have been assembled in a warehouse in the city staked out as a last-minute check point before racing into the embassy.

The troopers, commanded by Col. Charlie Beckwith, were going to thrust into the embassy like a stilleto, not a broad sword. The plan depended on speed, stealth and deadly marksmanship, not on some super-duper secret weapon like knockout gas.

The Blue Lilght commandos were going to kill or subdue the guards and herd the hostages to a predesignated rescue point, where the helicopters from the mountaintop hideaway would swoop down and fly them away to the C130s, which were waiting west of the city.

Blue Light's hand-picked sharp shooters were armed with .45 pistols with silencers and M16 rifles. These sharpshooters were so accurate, one source said that during training Beckwith and a visiting commander of a West German anti-terrorist outfit once confidently sat between target silhouettes while the commandos blasted away with their weapons.

If Beckwith needed outside help during the embassy takeover, he could have called in C130 transports armed with machine guns and 105-millimeter cannon.

The planes' crews were trained to orbit in the night sky over the embassy, "housing down the streets," as one source put it, to stop any Iranian forces that might have tried to stop the rescue.

Another C130 crew was ready to orbit over the Tehran airport, blasting the runways to stop any Iranian fighter planes which tried to take off from there.

Far to the south, in the Arabian sea and Gulf of Oman, the aircraft carriers Nimitz and Coral Sea had tricky assignments, too. Some of their war planes were prepared to make a feint at bombing Iranian oil fields at the head of the Persian Gulf, while others would protect the C130s and C141s flying out of Iran to Egypt with their load of hostages, commandos and perhaps a few of the friendlies.

Under that option, which might not have been exercised at all if the embassy takeover went smoothly, Navy A7 fighter-bombers would have feinted a bombing raid on the oil fields while F4 and F14 fighters would have provided the protective "cap" for the departing transports. Presumbly any Iranian planes which got aloft would have raced south to defend the oilfields.

Officials stressed that the warplane option was defensive in nature and not part of any offensive strike against Iran. Indeed, sorces say the plan did not include any punitive raids against Iran even in the event of a serious failure of the rescue operation. The idea was to stick to a rescue mission and not to undertake actions that could have inflamed the whole region and possibly driven Iran into Soviet hands.

Officials said it would have been too difficult to try to launch any sizable force of fighter-bombers over Tehran from the carriers. This would have required mid-air refueling at night since, when loaded, these warplanes have a combat radius of only about 300 miles.

The Joint Chiefs opted for going fast and light, counting on speed and surprise for success. This decision, sources said, resulted in paring down elements of one of the many preliminary drafts of the rescue plan finally implemented by Carter.

Planners anticipated that several Navy RH53 helicopters would fail in the two long hops from the Nimitz in the Gulf of Oman to the mountaintop hideaway east of Tehran, totalling 700 miles. Some planners early on recommended up to 12 to 14 helicopters instead of the eight decided upon.

Although they are not saying so publicly, many military officers now fault the final plan as "too thin," resting on too many unrealistic assumptions. Some contend the obstacles most likely would have gotten worse, not better, as the Blue Light team proceeded beyond Desert One, the refueling site 500 miles inside Iran, toward the embassy. They complain of too few "worst case" protective features in the planning.

Sen. Henry M. Jackson (D-Wash.) signaled last week that he is going to demand explanation on this point during the Senate Armed Services Committee audit of the rescue attempt.

The committee has scheduled a closed meeting Wednesday to start hearing from participants in the rescue attempt.

Although not yet briefed formally on the plan, Jackson said from what he has learned it did not have "enough redundancy, enough backup. In a mission of this magnitude, in which the whole world is looking at this, and after a series of defeats in Vietnam . . . it could hamstring the U.S. position in the world. If you are going to do it, there damn well ought to be some backup for contingencies."

Carter obviously felt otherwise as he took what looks like the biggest risk of his presidency -- to "lance the boil" of the hostage crisis.