From the Dictionary of Nautical, University, Gypsy and Other Vulgar Tongues first published in 1859.
Cat-in-the-Pan: a traitor, a turn-coat derived by some from the Greek, Karairav, altogether; or from cake in pan, a pan cake, which is frequently turned from side to side.
(Whatever the derivation, I like it. But perhaps it has to do with how quickly a cat can jump into and out of any situation. I had the lid off an aquarium once when the cat tried to jump on top. Once she hit the water, I’ve never see an animal move so fast!)
This has made my day! Sounds like a phrase Modest Mouse would use in a song