Sometimes the best puns arise by accident or error. English contains a multitude of idioms, and it's hard to keep up with them all, so we end up with mixed metaphors, malaprops, malaphors, and malaproverbs. You might even include malamanteaus. They are all mangled combinations of familiar idioms.
He knows where all the skeletons are buried.
Until the cows freeze over.
Give them an inch, then they take a foot, and soon you don't have a leg to stand on.
Once bitten, twice shy, three times a lady.
We'll burn that bridge when we come to it.
Don’t count your chickens until the barn door is closed.
You'll find more examples and links for plenty of mixed metaphors at Metafilter.