The 2010 PA Senate Democratic Primary, A contest between recent Democrat & Longtime Republican Senator Arlen Specter and Democratic Congressman Joe Sestak resulted in a political defeat for specter which he switched parties to avoid.
Seen as a blatant political move at the time, Specter's party switch occured because he determined that he had no path to winning reelection through the republican party, with 2004 Challenger Patrick Toomey gearing up for another primarhy after Specter was one of 3 republicans to vote for Obama's stimulus bill.
However, in joining he faced Joe Sestak, a congressman who was already challenging Specter when he swithced parties. And despite party leaders trying to clear the field for Specter—even offerinc Sestak a job in the Obama Admin if he dropped out—Sestak stayed in to oust Specter.
In this sense, Specter's loss can be atributed to the brazenness of the switch—with Sestak Running ads that charged him with only switching to the party 'to be reelected' (which Specter himself claimed)—he was hard pressed to succeed even with the full backing of the democratic establishment.