interesting !
https://tvtropes.org/pmwiki/pmwiki.php/Main/OrphanedPunchline
Two (possibly more) of the Star Trek novels had someone walk in a room in time to hear; "I don't know where you've been lad, but I see you won first prize." Which is the last line (more or less, as it varies depending on who's singing it) from The Scotsman Song.
In Robert A. Heinlein's Stranger in a Strange Land, the viewpoint character is told that "laughing because it hurts too much to cry" is the basis of all comedy, and she's shown to consider this by mentally listing the punchlines of all the jokes she knows:"-her entire bridge club"..."Should I bow?"..."Neither one, you idiot — instead!"..."-the Chinaman objects"..."-broke her leg"..."-make trouble for me!"..."-but it'll spoil the ride for me"..."-and his mother-in-law fainted"..."Stop you? Why, I bet three to one you could do it!"..."-something has happened to Ole"..."-and so are you, you clumsy ox!"
..............
..............
the woman says: [ But I ordered a fork ]
"-the Chinaman objects"