Thank you for your reply and hope you are feeling better.
I am going to appeal with help on the grounds of discrimination. That being that had I never even attempted to return to work and thus come off IB (at considerable health risk to myself) I would still either be receiving IB or have been automatically moved to contributory ESA without any question about NI credits.
Also the fact that in the two relevant tax years I do have maximum class 1 NI contributions paid albeit that they have been paid by the DWP on my behalf rather than through a salary as I was on IB. It seems that the DWP don't recognise NI credits that they have paid for you when it comes to claiming a subsequent contributory based benefit.
It's no encouragement for people who really want to give work their best go if they are going to be frightened that if they do fail they could end up in a far worse situation benefits wise.