In the original book, The Happy Medium is a woman with a far more pronounced happy-go-lucky sensibility.
Given Galifianakis’ emotional introduction to Ava DuVernay at their first meeting, perhaps that’s what ultimately sealed the deal.
In the movie, the character has a more profound emotional core and an undercurrent of sadness.
Of course, it’s also arguably surprising that Zack Galifianakis got cast as The Happy Medium in A Wrinkle in Time because he’s so fundamentally different from the character in the source material (though, in fairness, the movie makes a large number of changes to the novel as it is).