What is an idiom about something that we want it to happen in the way we've expected, but finally it turns out in the way we don't want it to happen.

For example, You give flower to a girl you like. A day later, she doesn't talk to you any more.

Another example, Jane thought that the guy who stole her car would be sent to a jail immediately. Surprisingly, he finally got away with it as Jane couldn't believe this did happen.

Look for idioms.

Thank you.
We say that a plan has backfired when the end result is the opposite of what we were trying to make happen. That might apply to your flower scenario.

I don't know what to call what happened to Jane. She was disappointed. Her hopes were dashed.

We sometimes say, "The best-laid plans of mice and men go oft astray." That's a garbled (or translated) quote from the Burns poem "To a Mouse". In the original: "The best-laid schemes o' mice an' men / Gang aft agley".
I can think of to blow up in somebody's face.
 enoon's reply was promoted to an answer.