What is the process of swapping two words in a sentence for comedic effect known as?

I have looked on the internet for this, and am repeatedly led to terms such as Malapropism, Anastrophe, Spoonerism, and even Ellipsis... none of which are correct in this case. I am looking for the term that describes the purposeful juxtaposition of two nouns, such as: 'It's time to put out the fire, and throw another log on the cat' (Richard O'Brien) or possibly 'With Gifts on the Fire and Logs on the Tree' (Mistletoe and Wine treated thus). The effect is that one of the halves remains plausible, but the other is ludicrous. Any assistance in this matter would be much appreciated, as I'm sure there has to be a word for it.


Solution 1:

This is comic inversion (or comedic inversion) or, more ploddingly stated, amusing reversal. It parallels your anastrophe, which seems to have no comic overtones.

The term is implicit in literary analysis:

Inversion and Subversion: During different eras, drama has been considered morally wrong, politically dangerous and dubious, but comedy has always been considered even more so. The key roles of comedy are to mock the authoritative ones, to invert hierarchies, to transgress from social rules, and to challenge the political system. However, the fact that all problems and inversions are resolved at the end have led some critics to believe that, despite subversions, in the end, comedy really is a conservative genre

Idil Hassan

Inversion – To find the funny, flip the idea backwards. It’s easy once you practice.

Meryl

"The Flippant Method": Comedic Inversion: "The Pseudo-Verbal Method of Stand-Up Comedy." (Flippancy Book 1) by Richard Hovelsrud

Goodreads