Is there an expression or idiom for the situation when you say something and then the opposite happens?
For example I say “Today I don't have so much work.” and then something happens and you have loads of work for the rest of the day.
"Speak too soon" is a suitable way of describing the scenario.
Tetsujin is correct that irony/ironic is NOT suitable, but strictly speaking coincidence/bad-luck/Murphy's law are not correct either. Bad-luck and Murphy's Law are indicative that the things you didn't expect to happen DID happen, and they have negative consequences. Your question could be positive or negative, and "speak to soon" covers both.
Speak too soon is usually taken to mean the OPPOSITE of expectation, like you describe in your example. You tell someone you have no work - oops, you spoke to soon and now you have too much work, for example.
Another alternative expression would be that you were too premature - e.g. if you celebrate winning a competition before finding out for sure you were the winner your celebrations are premature.
It's just a coincidence, bad luck, Murphy's Law.
If anything can go wrong, it will.
It is not irony.
just before someone jumps in with an answer saying it is.
Now I need to go find a link to the comedy sketch explaining why the Alanis Morrisette song "Ironic" contains contains no irony whatsoever....
Idiomatically, we might say that you jinxed yourself. Jinx means something like a curse or bad luck, or to cause bad luck to someone, as though saying "I don't have much work today!" caused more work to appear.
Maybe I've put the question in bad way. But I think that I have found the right expression and it is : “Must speak not too soon“