For the first time in the 23 years that she has lived under strict government confinement, Winnie Mandela, wife of imprisoned African National Congress leader Nelson Mandela, today challenged the legal validity of her restriction.

In the seaside resort of Wilderness, 600 miles south of here, six U.S. congressmen, led by Budget Committee chairman William H. Gray III (D-Pa.), met for nearly two hours today with vacationing President Pieter W. Botha. Botha reportedly attacked the United States for applying limited sanctions against South Africa, while the congressmen warned him there was now a consensus in the United States against supporting apartheid.

Gray said after the meeting the group had been given little hope that Botha was about to introduce major reforms to the segregationist system.

[In Paris, the French Cabinet approved a measure that would limit sales of military equipment to South Africa, United Press International reported. The sanctions must be approved by the National Assembly where President Francois Mitterrand's Socialist Party has a majority.]

In an urgent application to the provincial Supreme Court here, Mandela, who has been arrested twice in the past two weeks for defying a new order that prohibits her from living in her Soweto home, said she had refused to obey it because it was "grossly unreasonable" and "inhumane."

Her lawyer, Sidney Kentridge, argued that the restriction order was invalid because the government minister who issued it had failed to set out his reasons, which Kentridge said was the one small safeguard the stringent security law required for "this drastic incursion into the common-law rights of the individual."

The government's lawyer, J.M.C. Smit, will reply to Kentridge's arguments Thurdsay, but it is uncertain whether Judge Louis J. le Grange will give his verdict immediately.

Crowds of blacks gathered in a matter of minutes in the street outside the Supreme Court building in Johannesburg when Mandela arrived for the hearing this morning and again when she left in the afternoon.

The crowd chanted African National Congress slogans and there was wild cheering when Mandela raised her fist in a black power salute before her lawyers bundled her into an automobile and drove her away.

Mandela was previously banished to the black quarter of a remote farming village called Brandfort, 250 miles from here, but in August the house the government had provided for her there was firebombed.

Accusing government agents of trying to assassinate her, Mandela left the town in defiance of her banning order and returned to her home in Soweto, outside Johannesburg.

For four months the authorities appeared to condone her defiance while local and international pressures increased for the government to begin negotiations with the African National Congress. But after a series of insurgent attacks against whites in December, official attitudes hardened.

There were threats of reprisal raids against neighboring black states, which Pretoria accuses of harboring guerrillas, and the government seems to have decided that the mood of its white constituents made it impossible to continue tolerating Mandela's open defiance.

In acting against her, Pretoria seemed anxious to soften criticism. It relaxed her restriction order, ending her banishment to Brandfort, but ordered that she could not be in Johannesburg or neighboring Roodepoort. That effectively meant she had to leave her Soweto home.

That Mandela refused to do, resulting in the police dragging her from her home.

Kentridge said today Mandela refused to return to Brandfort because she believed her life would be in danger there.

To force her to quit her Soweto house under those circumstances, giving her no time to make alternative arrangements, was "an act of unreasonableness so gross as to amount to inhumanity," which in itself should render the order legally invalid, Kentridge said.

An aide to the U.S. congressional group said in a telephone conversation tonight that the meeting with President Botha had been negative, although not acrimonious.

Gray said the group had put six reform proposals to Botha, calling for equal education, an end to restrictions on the movement of blacks, changes to the laws on residential segregation, an end to forced removals of people violating segregation laws, the scrapping of bars on families joining black migrant workers in the cities and a lifting of restrictions on the media.

Botha had said some reform legislation would be introduced during the parliamentary session due to begin Jan. 31, Gray said, "but we were given no specifics."

"We were not given much hope of major reforms to the apartheid system," Gray added.

The Budget Committee chairman said the group had also been refused permission to see Nelson Mandela in prison, and told that his release was "not a possibility."

The semiofficial South African television service quoted Botha tonight as having told the congressional group that President Reagan's imposition of limited sanctions was a "bad, miserable decision" against "one of the best developing countries in the world."

The incipient war of insurgency, which has resulted in 13 white deaths in the past three weeks, showed further signs of intensifying when a mine exploded at an electrical substation in Pretoria, and a man police said was an insurgent was shot dead in Soweto. This was the second alleged insurgent killed in a black township in the past two days.

Botswana's Foreign Minister Gaositwe Chiepe said her government had called on the United States, Britain and West Germany, South Africa's three leading trading partners, to urge restraint on Pretoria after its threat of raids in reprisal for recent insurgent attacks.

Most black secondary schools were either deserted or had only a sprinkling of students as the 1986 academic year began today.

Student activists forced a boycott of schools through most of 1985 as South Africa experienced the most widespread racial violence in its history. Last month an action committee of parents and educators urged a conditional return to school, pledging that they would support the students in a nationwide protest campaign if their demands for educational and political reforms were not met by the end of March.

A further 3,000 black miners were fired from platinum mines in the nominally independent "homeland" of Bophuthatswana today, bringing to 23,000 the number dismissed since Monday following a week-long strike at three mines controlled by a company called Gencor.

A police spokesman, Col. Jaap Venter, denied residents' claims that police were besieging villagers in Moutse black reserve, north of Pretoria, who fled into surrounding bush country after two policemen were killed there on New Year's Day.

Local people said about 600 villagers, including women and children, are in hiding, living on roots and wild berries because they fear arrest if they return to their homes.

Venter confirmed that there was "a police presence" in the area, and that 89 men had been arrested in connection with the killing of the policemen, but said there was "absolutely no truth" to the allegation that fugitive villagers were being besieged or starved out of the bush.

Moute's 120,000 people are resisting incorporation in a neighboring tribal "homeland."