Hi …..
Your speculation is correct.
let the cat out of the bag
Give away a secret, as in Mom let the cat out of the bag and told us Karen was engaged. This expression alludes to the dishonest practice of a merchant substituting a worthless cat for a valuable pig, which is discovered only when the buyer gets home and opens the bag. Also see pig in a poke
spill the beans
Disclose a secret or reveal something prematurely, as in You can count on little Carol to spill the beans about the surprise. In this colloquial expression, first recorded in 1919, spill means "divulge,"
Regards.
V.