As F-F points out, as long as the employer steers clear of areas covered by equalities legislation, you can be dismissed for any reason (or for no reason whatsoever) within the first two years of your employment. (i.e. it would be unlawful for an employer to sack you within that period because he'd found out that you were Jewish or gay but perfectly lawful for him to dismiss you purely on a whim).
If your mental health problems were seen (in legal terms) to represent a 'disability', then your employer would be obliged to see if there was a way to 'make reasonable adjustments' in order to allow you to continue working (and you couldn't lawfully be dismissed simply because you'd been employed for less than two years). However if no such adjustments were possible then you could still be dismissed.
Most employers will start to question whether it's reasonable to retain an employee's services if their absence rate falls much above 2% but yours is over 20% (and possibly closer to 30%, depending on the exact dates involved) so, as I see it, the deal you're being offered is actually quite generous.