There were cocktails, and there were sliders. There were pop hits played by a D.J. at The Bungalow, a midcentury-modern lounge in Long Beach, Calif., where Representative Katie Porter had gathered supporters after more than a year of campaigning for a coveted Senate seat.

But there were no televisions.

The crowd — and Ms. Porter — had already guessed what election night had in store.

Had there been screens blaring the news, supporters would have seen a Democratic rival, Representative Adam B. Schiff, advance to California’s general election runoff in November. And shortly thereafter, they would have watched Steve Garvey, a Republican and former baseball player, take the other spot — in no small part because of a stratagem by Mr. Schiff that sidelined Ms. Porter at the earliest opportunity.

It was the end of the road for Ms. Porter, 50, a liberal Democrat who built a following by chastising pharmaceutical executives with a simple whiteboard on Capitol Hill. It is unclear where she will go from here because she had to relinquish her House seat to run for the Senate.

She had effectively used social media and become the candidate of choice for suburban progressives. But it was obvious that Mr. Schiff, beloved by other Democrats for pursuing impeachment charges against former President Donald J. Trump, was the establishment pick.

In the early months of the campaign, Democratic heavy hitters coalesced around Mr. Schiff, 63. And a prized endorsement from Nancy Pelosi, then speaker of the House, brought unmatched fund-raising power.