Arab foreign and economic ministers failed again tonight to agree on how to punish Egypt for signing a peace treaty with Israel.

A final session of their conference that was to have been held tonight was postponed after the participants caucused and negotiated privately for several hours in a vain search for a compromise formula.

There was no official account of what was happening, but conference sources said that moderates led by Saudi Arabia had offered a compromise that would impose economic and political sanctions on Egypt without a total cutoff of aid or diplomatic relations. Hard-liners led by Iraq and Syria rejected it, the sources said.

Iraqi officials announced that the informal meetings would continue through the night and the conference would resume its formal session on Saturday morning.

By late tonight it was clear that all 19 participating delegations agreed on the need for some action against Egypt and perhaps on the need for a new Arab summit conference to authorize even harsher measures than are under discussion here. But he hard-liners were taking an all-or-nothing posture that made compromise difficult. By insisting on what was not withing reach, they were making it possible that the conference would remain paralyzed altogether.

According to Arab journalists who have access to the meeting and to other sources, the Saudis were offerington to go beyong the position they took in earlier sessions. Saudi Foreign Minister Prince Saud had argued that this conference was not authorized to do anything more than implement the relatively mild sanctions approved against Egypt by a summit gathering last November.

Iraq, Syria, Libya, the Palestine Liberation Organization and several other delegations were pressing for a complete rupture of all economic and diplomatic ties with Egypt-a step the Saudis say this meeting has no power to take even if all participants wanted it.

As Iraqi delegate Tarek Azia put it, the issue was "should we stand against [Egyptian President Anwar] Sadat and boycott him or should we stand halfway between thus keeping bridges open with this traitor."

The Saudis, who have contractual commitments to finance major Egyptian military purchases and are unwilling to risk a total rupture with a powerful neighbor, have not been willing to go that far.

Conference sources said the Saudis offered a compromise under which this meeting would recommend that all Arab states withdraw their ambassadors from Egypt-as they are expected to do anyway when an Israeli ambassador arrives in Cairo-and cut off the collective aid they have been giving to Egypt since 1967 as a "confrontation state in the struggle against Israel."

They reportedly made this move after a 24-hour recess in which the participants, after admitting they were unable to reach agreement, consulted their home governments. The foreign ministers of Saudi Arabia and the Gulf sheikdoms had a separate meeting in Kuwait today before returning to Baghdad.

Prince Saud returned in a conciliatory mood, apparently ready to compromise and issuing a statement shrugging off an attack on him made by a member of the PLO delegation earlier in the meeting. But despite SAUD's statement that the issue could be settled in 15 minutes the hard-liners reportedly refused to budge.