I am in a similar position in that I am being treated for cancer and I work for the NHS. I was off for 6 months between the end of June and the end of December. I returned to work on phased return in January, then I used saved up annual leave to reduce my hours by one day a week for a while, before going back permanently on reduced hours. I haven't had to take any more sick leave yet, luckily.
Your situation doesn't sound right to me. Check your Trust's sickness policy. I believe the regulations are the same for all NHS trusts but there may be some local differences.
You also need to check through any communications you have received from your line management, occupational health or HR regarding your sickness, and think carefully about whether you have done everything you need to have done and whether you have done anything you should not have done.
If you are sure that you have acted appropriately and that you have not received any communications about this, and you have checked right through your Trust's sickness policy and there is nothing in there to explain the P45, then query it with HR in the first instance and contact your union rep for assistance.
I have been incredibly lucky in the support and help I have had from my department (corporate, not clinical), and I know that other people may not have as much support, but I am sure that, based on the information you have given us so far, this is not the correct procedure. Hopefully it is just an error.