WASHINGTON — As the Senate plowed through gun amendment after gun amendment on Wednesday evening, Senator Patrick J. Leahy, the Judiciary Committee chairman, sat at his desk on the Senate floor in increasing agitation as a potentially momentous personal achievement collapsed in a partisan morass.

“The committee held three hearings and four lengthy markups starting in January and concluding in March,” Mr. Leahy, Vermont’s senior senator and the newly anointed president pro tempore, said in bitter frustration. “No good deed goes unpunished.”

It was the opening act of perhaps Mr. Leahy’s biggest moment after 38 years in the Senate, and it was crumbling around him. Act II began Friday, with Mr. Leahy’s Judiciary Committee plunging into the first formal hearing since a sweeping overhaul of the nation’s immigration laws was introduced in the Senate.

He can only hope this one goes better.

Over nearly four decades, Mr. Leahy has compiled an extensive résumé of workmanlike accomplishments, lauded but little known beyond the immediate beneficiaries: the Patrick Leahy War Victims Fund, the Leahy Law that controls American military assistance to governments with questionable human rights records, patent law, privacy protections, organic food labeling and agricultural conservation programs. Important achievements, he says, but not the sort carved into marble in the Capitol.