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.
I believe the whole nine yards refers to a very fancy gown with nine yards of fabric
I’ve seen a lot of “explanations” for ‘The full nine yards’ including the length of machine gun ammo Belt, the length of a Belt of aircraft ammunition, the amount of fabric required for a full formal kilt, and the length of a ship’s anchor chain. There are lots of explanations but few facts.