To consider your second example, given in comments:
"Pushing the villain off the roof while monologuing" is a subversion of the fictional conventions that the GM expected. Put simply, it is not realistic for the villain to stand around completely defenceless grandstanding (at least, not if he's supposed to be a genuine threat), so you can either have a game that adheres to the convention of the villain doing exactly that for no discernable in-character reason, or you can have a game in which the PCs pursue every possible advantage, but not both. Some RPG systems address more directly than others, the fact that much fiction is not "realistic" in every sense.
We can argue all day, to no effect, which is better, but if both you and the GM want a game in which the former thing happens (and, conversely, the players can get a causality break or a brief time-out when they think of something to do or say that's dramatically interesting but tactically very weak), and your system doesn't constrain you with rules that enforce a particular set of genre conventions, then you both have to play along to the convention. If you want to play the latter game, OK, but it cuts both ways, and expect the GM to time anything you say in character during combat. If it takes longer than the number of seconds in a combat round, well, apparently now you're monologuing, and we've already established that apparently there's a house-rule that says your opponent can shove you off a roof. Oops ;-) Not that I think the GM should actually do that, because it'd be a rubbish house-rule, it's that both the players and the GMs should only be attempting and allowing actions that actually make sense in whatever terms your game is played. That's not necessarily a gritty realism that ruthlessly punishes dramatic exposition.
However, I agree with other answers which state that the GM should make the bad guys more robust to this kind of interference. The root problem here isn't that you didn't get to see all the cool stuff the GM thought off, that's the just the effect. The problem is that the bad guys were too weak to be interesting, and the players can't solve that problem without the GM doing something.
Basically, the villain doesn't need to be insta-killed just because he happened to be speaking at the time the PCs attacked him, but the GM has probably decided in the moment (and perhaps thought better of it later), that playing along with the convention-subverting joke was a better option than either enforcing the convention ("villain is immune to all attacks until speech is over") or else making plausible-in-character responses to your plausible-in-character attack ("villain defends himself -- what, you think you can just push people off roofs as an automatic success? Give me a break")
Going back to the sea monster, there are a lot of computer games where end bosses automatically convert into bigger, cooler monsters when they take a certain amount of damage. If that's the effect the GM wants to achieve, then he needs to work with the system of whatever game you're playing to get where he wants to go. Or, if it's a game with the GM as auteur, change the system. Invent a "triggers on serious injury or death" condition for summoning the sea monster. One single spell should not be enough to kill the bad guy before he gets a chance to do the most interesting thing he can do. It's on the GM, not the players, to stat the bad guys, and it's not railroading to choose/invent bad guys that can survive one round of combat, or bad guys where the consequence of killing them is more bad guys!
I contend that with a bit of communication (traditionally initiated by the GM) about what style of fiction you're building, most players are smart enough to recognise the "villain's speech" convention if they try, and to play along. The speech is "allowed" to harm the villain in the sense that it gives the heroes time to recover from some inconvenience, escape from being tied up, when the villain "should" have ruthlessly killed them ASAP. But it isn't "allowed" to harm the villain to the extent of making him vulnerable to an insta-kill. The sea monster is pretty much entirely a GM error, because once the fight starts the PCs should be expected to fight, and these bad guys just weren't tough enough to take them on. One of the responsibilities of the GM is to understand the rules well enough not to be surprised if the players' listed abilities can wipe out the plot in a single blow. If a player does something spectacularly clever to end the fight before it starts, that's another matter, and shouldn't just be railroaded away. But "fire off my best damage spell" is not that.
So, if you want to play to a particular set of conventions, then both players and GM need to resist the temptation of making jokes that discard the conventions, or tactical decisions that ruthlessly exploit them. The villain doesn't hunt down and kill the PCs' parents in a light-hearted comedy game and say that's what "his guy" would do, and the players don't take too much advantage of a villain's exposition of the plot and say that's what "their guy" would do. If you want to do it by the book, not by "unrealistically" playing along, then the GM needs to know the book better.
The Big Bad tries to dodge your attack *rolls 1* he trips over a rock and dies
\$\endgroup\$