My postdoc contract was near its end, and I asked briefly my manager earlier this year if the chances of extension are high, they said no, so I started looking for jobs with a new mindset, without mentioning this again. (it was literally a 1 minute conversation) Months later, my manager messages me to talk about my extension in their office. Verbally, they state there is new money available, and the extension can be granted for a few months, with almost complete certainty. A month later (and a month to the end of the contract), I am called again to their office only to be told how my publication record is low and the extension cannot be granted anymore. No matter how many times asked, no clear tangible reason is given for the shift. Clearly, legally I cannot do anything as there was no extension contract. However, is it considered absolutely fine for a manager to keep going back and forth on contract extensions? Psychologically, it creates an enormous amount of stress. Now, I am almost guaranteed to have a gap in employment. Of course, none of this is to excuse me for not having clearer plans earlier, but this situation made it significantly worse.
There are different degrees of "fine" and "not fine".
Sometimes things are sufficiently not fine that you can sue to force things to change or for some compensation. This wouldn't be one of those.
Some things are not fine in that they cause distress or hardship to someone in a vulnerable position, like in your case. You are justified in being upset but there's not much you can do about it except to move on and get yourself a new position. It's possible that no real harm was ever intended and the decision may not even really be in the hands of the people you interact with: maybe they really thought there would be more money available and now there is not.