That wasn’t Brooks on screen in the movie, just his voice dubbed over the actor. His version of the line is also dubbed into each performance of the musical, as well as the 2005 movie version.
Another famous heard but not seen in the film is Buddy Ebsen in the “Wizard of Oz.” Many are familiar with the aluminum paint allergy story keeping Ebsen out of the role of the Tin Woodsman in the movie. Most don’t know that the song “We’re Off to See the Wizard” was one of the first things done for the film. By the time production was in full swing and Ebsen was since replaced they had the song already in the can and decided it’s would cost too much to redo it. So Buddy Ebsen’s voice only is heard in the final print in just that song.