As lawyers like to say, “it depends”. Months, like, “a few”.
For someone in the situation-SWIM-my suggestions would be something like:
Document. Get criteria for “improvement”, down to nauseating detail. Meet it, and if they still fire you, well, then a lawyer will be more interesting.
This all presumes you weren’t asking for it, and it’s political opinion some way.
If you were asking for it, improving for real might be enough.