The breakdown of U.S.-Mexican talks on natural gas sales last week appears to assure that no major accords will be reached when Mexican President Jose Lopez Portillo goes to Washington later this month for talks with President Carter.

The hope here that an important agreement could be initialed by the two presidents ended when high-level negotiators for the two sides once again failed to settle on a price for Mexican natural gas sales to the United States.

With no new gas negotiations scheduled before the Sept. 28-29 visit, the two presidents will have little else to discuss except for the equally thorny issues of commerce and illegal alien workers, on which they are no nearer agreement.

Nearly six months have passed since President Carter visited Mexico, attempting both to clear the air after the U.S. government's blocking of a gas deal and to make a high-level commitment to seek to resolve several other important differences.

The lack of significant progress on the issues stems not only from their complexities or from lack of sufficient political will. It also reflects the difficulty of harmonizing the interests of two countries gripped by c hange: The United States trying to adjust to its new vulnerability in energy and Mexico sorting out its new energy wealth. This has opened up entirely new areas of friction.

The latest deadlock in the gas talks, following the most intense negotiating round so far, has once again produced press comments on the "badly strained relations" and "a new low between the neighbors."

Diplomats of both countries dismiss these assessments and say that the main problem with the elusive gas deal is that the decision to hold government-to-government talks was heralded as the most significant result of Carter's February visit here.

"Unfortunately, gas has now become the gauge of U.S.-Mexican relations," said a U.S. official, adding that last week's U.S. mission, headed by Deputy Secretary of State Warren Christopher, had come here with instructions to do the utmost to close the deal before the presidents meet. When they failed, Mexican officials briefly considered calling off Lopez Portillo's visit to Washington.

Diplomats on both sides now dismiss the deadlock as just one of the many commercial arrangements that fall through every day.

Yet the gas saga is symptomatic of U.S.-Mexican relations because of the misunderstanding and posturing on both sides that has accompanied it for the last two years.

Part of the posturing is that both sides claim they do not need the deal at all. Americans say there is a natural gas glut in the United States and the "high" Mexican asking price is unrealistic and unappealing.

A key Mexican official recently said here that "the president believes he's doing Carter a favor by offering to sell gas to the U.S." Moreover, since the fall of 1977 when then-energy secretary James Schlesinger vetoed the first gas contract, Mexico decided to keep most of the surplus gas at home.

A vast pipeline network is ready and Mexican industry is switching from oil to gas as the prime energy source.The national electricity and oil companies, it was announced recently, use 60 percent of Mexico's gas production. The surplus available for the United States, it is said here, has therefore fallen from 2 billion cubic feet a day to 300 million.

"And if necessary we will keep burning it off," a Mexican official said.

There is also a simmering distrust that stems from the vastly differing national interests, negotiating style and value systems of the two neighbors. This accounts for the frequent misunderstandings.

A few weeks ago, for example, when U.S. Ambassador Patrick Lucey, in a call on the Mexican president, talked about gas prices, Lopez Portillo reportedly said his problem was not with prices but with principles.

The result of the talk reportedly was that Lucey believed Mexico had agreed to the U.S. price offer. American negotiators were hastily summoned. As they arrived in Mexico, however, they found no such agreement. Angered U.S. officials then reportedly told U.S. reporters that Mexico had reneged on the deal. This in turn infuriated the Mexicans.

Last week the talks stalemated as the two sides appeared closer than ever to a settlement. Mexico had asked $3.75 per thousand cubic feet of gas, and the United States had offered $3.50. Mexico proposed to split the difference and settle on $3.625. Both sides reportedly agreed. Then, according to a Mexican official, the United States tried to change the already agreed delivery date from November to next April. Apprised of this, the Mexican president reportedly told an aide, "That's enough."

The U.S. mission, which had postponed its departure to reach a happy end, returned to Washington.

The next day Mexican Foreign Minister Jorge Castaneda curtly told a news conference that no new gas talks were expected.

"Perhaps later, when circumstances have changed," Castaneda said. "And next year we'll have to negotiate on the basis of new prices."

At times the Mexicans and Americans seem to enjoy sparring and muscle flexing instead of trying to avoid it. Last week's flap over the U.S. requests that Mexico pay the cleanup costs of the oil spill in the Gulf of Mexico is a case in point.

The Mexican reaction was nothing less than nationwide outburst of nationalism: First Lopez Portillo condemned the U.S. publication of the request and then said flatly "no," as a matter of principle.

Then all seven political parties announced they were "rallying around" the president while newspapers and magazines printed anti-U.S. headlines, cartoons and paid advertisements.

As the dust settled, a U.S. official commented coolly: "The fuss was only about a few million dollars. But frankly, we didn't have a very good case."