In the Bee Gees' case, I think if you asked anyone on the street to name the first Bee Gees song that comes into their head, I bet they'd name something from Saturday Night Fever. 10 bucks says it would be 'Stayin' Alive'!
Having said that, my favourite period of theirs is definitely the 60s work. Fave songs are 'New York Mining Disaster 1941', 'World', 'Holiday', 'Massachusetts' etc (as you can see, I'm a HUGE fan of that 'Horizontal' album!). But the disco period is equally as outstanding. 'Tragedy' is a fantastic song.
Heading across to Paul McCartney, I think the 'Mary Had A Little Lamb' thing makes very little difference to his legacy. If you asked the ordinary person on the street, chances are they wouldn't have even heard the song. People generally regard 'Silly Love Songs' as a boppy upbeat 70s tune much like the Bee Gees stuff - they don't regard it in the same terms as a discerning looking-down-his-nose music fan would.
I think the thing that hurts his legacy the most is when he's lined up to perform in VERY public events (like the Queen's Jubilee and Live Aid for instance) and unable to deliver the goods vocally. That always makes me sad as a McCartney fan - I've seen him live in the last 5 years and I know he CAN still sing really well - but he also has his share of off-nights.
The thing I thought would hurt someone's legacy, but doesn't seem to do it, is when an act sings most of their songs in lower keys - Fleetwood Mac, Elton John, Black Sabbath for example. The fans oddly don't seem to notice it or mind it, but to me they can sound like a 45 playing on 33!!