In the scheme of things, it makes total sense to keep that flub in the film. The scene has a lighthearted feeling, a sense of whimsy and levity that is meant to be charming and good-hearted for the dramatic stakes of the story are introduced to, and by, our central characters. This silly little mistake on set ultimately made the scene better, effortlessly helping to establish Gandalf’s enormous size compared to the hobbits and how he is unable to adjust to their cramped living quarters. The result, ultimately, was a splash of movie making, even if it was completely accidental in how it came to be.
Article source: https://www.cinemablend.com/news/2475173/5-lord-of-the-rings-movie-facts-you-probably-dont-know