Engaging storytelling is all about subverting expectations, and one of the most efficient ways for a director to do this is to cast an actor playing against type. If an actor is known for playing a villain, put them in your story early on, have them appear menacing, and then flip the switch on the audience like Alan Rickman in the Harry Potter films. Or take an actor known for their "nice guy" persona and use it against the audience in a big way.
Cinema history has given us plenty of great casting against type examples, from Anthony Perkins back in Psycho to Dick Van Dyke in Night at the Museum. It's always who you least expect, and these actors played roles that audiences never saw coming. Vote up your favorite "nice guy" characters who turned out to be not so nice after all.