I've seen a similar thing happen to several friends and family in recent years. Even if your employer is generally a decent place to work, you can wind up with an immediate line manager who is hostile. This might be through no fault of your own, for example if the manager isn't actually very good themselves and so wants to put together a compliant team so they can take credit for the efforts of others. Keeping around competent but independent types who know what they're doing and might challenge the manager when they make bad calls is a threat to these people.

It seems that such managers often do get called out eventually, particularly if they have a pattern of mistreating their immediate subordinates and start to show abnormally high numbers of complaints or people within their team moving on. Sadly, by the time that happens, it is usually too late for any of their immediate subordinates whom they have already started to victimise. They always know the formal procedures better than you do, because this kind of person builds their whole career around playing the game to their own advantage. Starting the disciplinary process on dubious grounds before the subordinate can start a formal grievance procedure is straight out of their playbook.

So my advice would be along similar lines to fsk's: work on the basis that this job is over, look to the future, but don't burn any bridges unnecessarily with the current employer or anyone else who works there.

In addition, if you are one of the victims here but have generally done a decent job and got along with people other than the problem manager, you have probably earned some respect from other people senior to you in the organisation. They might be peers of your manager, whose teams you have worked with along the way with good results. They might be people higher up in your own management chain, who have seen good results prior to the hostile manager taking over (and may have their own concerns about that manager, though if they're professional they probably won't give you any hint of this, they'll only discuss any concerns you raise yourself).

These people may be able to give you a useful reference in their official capacity, so you don't need to rely on the current line manager when applying for new jobs. If company policy forbids that, for example because the only permitted official references come from HR and just confirm dates of employment, then perhaps your contacts can at least give you a positive comment on LinkedIn or some other sort of constructive but unofficial endorsement.

Also, keep records of everything you legally and practically can. Remember that anything stored on company machines (particularly things like e-mails or any internal performance reviews) can be cut off at the employer's whim, and probably will be cut off without notice the moment the official firing process starts, so if you can get a copy that is under your own control, that is to your advantage. Also make written notes immediately of what was said in any in-person conversions or phone calls that might be relevant to your situation, such as the exact words used that you took to imply the 30 day review was being treated as a formality.

You don't necessarily have to ever use any of this stuff. My instinct personally is to fight these kinds of injustice, but as fsk said, that's often a lot of stress with little real upside, and literally everyone I know who has actually been in this position hasn't felt it was worth it. However, if your soon-to-be-former employer tries to come after you thanks to your manager's efforts, or more importantly if once you're gone they try to blame you for any actually illegal things that might have happened, then you want to have a mountain of evidence of the way they have tried to force you out and/or cover things up, and the fact that your own work wasn't to blame and you tried to act reasonably and do the right thing when you became aware of a problem. In short, you can be discreet about it, but always look out for number one in these situations.

And finally, keep your chin up. This kind of situation is right up there with hassle moving house or relationship problems in terms of stress and how all-encompassing it can feel, but always remember that the kind of hostile middle manager who causes these problems rarely has nearly as much influence as they like to think they do outside their own little empire. Chances are no-one is really able to give you a black mark across your whole industry or city just because of this, particularly if you can follow the advice above to get favourable endorsements from other senior people and keep a clear record to show that you weren't really the troublemaker. In any case, it's a good idea to reach out to friends and family who aren't involved for support, so your life doesn't become all about this over the next few weeks or months.

Good luck.