I believe the answer is: irony of situation
Irony of a situation refers to an event where the action that made by a certain character actually resulted in the opposite effect of what the character's intended to be. Writers usually use irony of situation to move the plot forward or as a comedic value.