If you make a list of the best examples of dream casting in sci-fi and fantasy cinema over the last two decades or so, Sir Ian McKellen as Gandalf is almost certainly near the top. But McKellen recently revealed that he almost quit the role before he ever got a chance to pick up Gandalf's staff.
As production was starting on The Fellowship of the Ring, McKellen was set to play the role of Gandalf, but another big role in another big movie—Magneto in Bryan Singer's X-Men—presented a scheduling conflict. McKellen had to choose one role or the other, and though he now calls Gandalf "the role of a lifetime," he was leaning toward Magneto.
The difference-maker was the founder of New Line Cinema, Bob Shaye, who bumped into McKellen in London before the actor did anything crazy. McKellen explained the dilemma, and Shaye worked with Peter Jackson to re-arrange the Lord of the Rings shooting schedule so that the cast and crew could film for three months without ever needing McKellen.
So, thanks to Shaye, McKellen was able to be both Master of Magnetism and the baddest wizard to ever walk Middle-earth. It's hard to imagine anyone but him playing Gandalf (well ... maybe Christopher Lee, who ended up playing another wizard), but could he have handed the Magneto role off to someone else?