Peanuts was originally sold under the title of Li’l Folks , but that had been used before, so they said we have to think of another title. I couldn’t think of one and somebody at United Features came up with the miserable title Peanuts , which I hate and have always hated. It has no dignity and it’s not descriptive.
According to this website which looks like it’s associated with the History Channel United Features changed the name because of a copyright concern and may have chosen the name based on the Peanut Gallery from the Howdy Doody show.
Yes, IIRC the peanut gallery was so named because it was the balcony (“gallery”) with the cheap seats, and a common treat for the poorer folk and children who inhabited it, often in the matinees, was peanuts. (Which they could throw at bad performers, since lacking rotten tomatoes). Hence the name carried over to the similarly boisterous audience in the children’s show.
So whoever suggested the name was thinking of a rowdy bunch of kids. Which really doesn’t describe the overall tone of Peanuts the comi strip.