I am going to contradict the other answer. Humpty Dumpty may not have been an egg at conception, but he was certainly one by 1835, thirty years before Lewis Carroll wrote Alice in Wonderland.
There was a long poem published in 1835, Child Capone's Nonage, by A Monk, which you can find on Google books, which has a footnote which starts:
“Humpty-dumpty sat on a wall,
Humpty-dumpty had a great fall:
Not all the King's horses and all the King's men
Could set Humpty-dumpty right agen.”This nursery rhyme upon an egg, which every body remembers, represents, under a beautiful allegory, the easy lapse of a child from his early position of virtue, and the vast difficulty of reclaiming him at school and college, even though these may have been founded and endowed by kings.