Irony: when the opposite of what you expect happens.
In this regard, what does it mean when someone says something and does the opposite?
Antiphrasis is the rhetorical device of saying the opposite of what is actually meant in such a way that it is obvious what the true intention is. Some authors treat and use antiphrasis just as irony, euphemism or litotes.
Besides, when the outcome is the opposite of what is expected?
Situational irony is when the outcome is the opposite or completely different from what was expected. Situational irony involves the result of a situation not matching with your expectations, such as a baker being allergic to flour.