After having DD4 fall backwards, after sitting crosslegged on the picnic table, head first onto concrete on Tuesday, I think object lessons are really relative.
I think my lines drawn for object lessons were reasonable -- and, no, this is not something I'd stand by and watch/let happen to any child. That wouldn't be a lesson at all; that'd be cruel & irresponsible. Certainly there's plenty of fuzzy gray area along that dividing line between "object lessons" and "child endangerment," which parents need to discover for themselves.
I don't want DD experimenting with drugs or a friend with benefit. There are things I cannot control when she will be 14.
Have your kids volunteer in a cancer clinic/hospice care environment. In the scouts, our troop volunteered for over one summer month @ 3x's week. The stories we heard first hand along with the images we saw were infinitely more powerful than the most "serious" video about drug abuse that we were forced to watch in school. 30+ years later and not a single one of us has ever been mixed up in drugs... and those of us still in contact credit that experience first and foremost. That was an object lesson, too.
So why is not letting your child eat PB different than forcing my child to eat the fruits and vegetables when her problem is with her bowels. Your allergy is more of an exception than her physical problem?
If lack of fruits & veggies causes icky bowels -- and does not risk loss of life, limb or eyeball -- hopefully the child (with parental guidance) will be able to make the connection between healthy diet and happy bowels.
Our kids were wickedly allergic to dairy as infants and at that age, it was our responsibility entirely. Now, as kids, a little too much milk still causes considerable discomfort (to put it mildly). They once were at a friends house & had a big milkshake, despite knowing that they weren't supposed to. Both of them were in turmoil that night & we had no trouble connecting-the-dots with them. Two & three years of "Don't drink too much milk"... "Don't drink too much milk!" ... didn't work. But it's been 18 months since the "Great Milkshake Incident of 2008" and they don't even hear the ice cream truck anymore.
Contrast this with my sister's kid who apparently has such a severe reaction to peanuts that anaphylactic shock is almost a guarantee... and my sister even keeps a tracheal tube in each vehicle just in case. So, no, I wouldn't advocate a "let him find out for himself" approach here.
I know that parenting styles vary wildly; and despite my absolute perfection in all other realms, I probably will make a mistake in child rearing at some point in the future. So I sure as heck won't sit here and say my way is the best for everyone -- it's just the best for us.
This old ditty has worked very well as a guide in our family for as far back as anybody can recall: "What doesn't kill 'em, makes 'em stronger."