WASHINGTON — When Representative Thomas Massie heard that House leaders wanted to pass a $2 trillion stimulus measure to respond to the coronavirus without so much as a recorded vote, he swung into outraged action.

He got into his black Tesla on Wednesday and began the drive from his home in northeastern Kentucky to the Capitol, determined to object to its quick passage and insist that lawmakers show up in person — in defiance of public health advice — to register their support or opposition.

“I came here to make sure our republic doesn’t die by unanimous consent and empty chamber,” he said on the House floor on Friday.

Mr. Massie, the libertarian whose contrarian streak has earned him the moniker “Mr. No,” ultimately failed when House leaders in both parties united to deflect his stunt, assembling enough lawmakers in the chamber for a quorum and allowing the bill to pass by voice vote after all. President Trump signed the bill later in the afternoon, sending direct payments and jobless aid to taxpayers, help to states and hospitals battling the disease, and government bailouts to businesses battered by the crisis.