No. The child role in Flubber (1997)—Weebo, the flying robotic sidekick—is played by Zachary Williams, Robin Williams's real-life son (born 1983).
Haley Joel Osment (born 1988) was 9 at the time and not in the film. His breakthrough was The Sixth Sense (1999). The confusion likely stems from: both being prominent child actors of the era, both working with major stars (Williams / Willis), and the "cute kid in a Robin Williams movie" mental bucket.
Zachary Williams later appeared in What Dreams May Come (1998) and October Sky (1999) before stepping back from acting.