Humpy Dumpty wasn’t always an egg perched precariously on a wall. Humpty Dumpty actually was first a drink of brandy boiled with ale back in the eighteenth century.
Later it became slang for a clumsy person (most likely intoxicated from Humpty Dumpty)
Only then did it end up in the rhyme, yet notice the rhyme never states that Humpty is an egg. That has been inferred by artists. He is now forever in our memory as a forlorn egg in pants.