This is a very interesting language history post about dead metaphors and malapropisms. A malaprop is the mistaken use of a word in place of a similar-sounding one, often with unintentionally amusing effect, as in, for example, “bone apple tea” (instead of bon appétit).
“Let the cat out of the bag” isn’t to do with the cat o’nine tails, it’s linked to another phrase “buying a pig in a poke”.
On market day, medieval con-artists would have a small stall selling piglets cheap. The mark would pick the one they wanted, then the seller would go to put it in a sack (aka a “poke”), but while their back was turned they’d switch it for a sealed sack containing a less valuable animal, like a cat.
If the buyer opened the sack to inspect their purchase , they “let the cat out of the bag”, hence it’s modern meaning of revealing a secret or something hidden. If they buyer didn’t look until they got home, they’d “bought a pig in a poke”, a phrase that means buying something blindly or without inspecting it properly.
I’ve also heard that “the whole nine yards” refers to the length of a round of machine-gun ammunition. But I saw that on social media, so it might be fake news.