It nearly happened in December 2006, after Tim Johnson (D-SD) suffered that stroke. If he'd died, Governor Mike Rounds (R) would have been empowered to appoint a Republican to replace him, thus transforming the Senate from 49-49-2 Democratic control to 50-48-2 Republican control.
And when Paul Coverdell (R-GA) of Georgia died in 2000, Gov. Roy Barnes (D) appointed Zell Miller (D) to replace him, although that didn't switch control of the Senate.
That's a bit of a stretch...
At the time, Miller was believed to be a solid if conservative Democrat. He didn't go pseudo-Republican until he'd won election in his own right in 2000 and George W. Bush came to Washington, giving him Republican initiatives he could sign on to.