Other mistake: Bogeyland is just across the river outside of Toyland's gate, as we saw towards the end of the film, so it doesn't make sense that Barnaby had to climb down a well to enter it.
Continuity mistake: When Tom is on trial, the large crowd is there to witness. Barnaby is there, thinking he got away with his ploy. There is a man standing next to Barnaby who disappears from the wide shot and reappears in the closeups.





Answer: Stan and Ollie were based on Tweedle Dum and Tweedle Dee. I believe the character of Barnaby was created for the movie.