I can't really tell from the OP original description of events ... so I'll ask. OP -- was there ever a moment when you asked your boss or the HR folks, "So ... what are my options?" Thereby putting it in their court and having them tell you what WAS possible under company guidelines? This is usually a great way to go about things, because you're kind of forcing them to tell you what is and isn't allowed, and the onus is on them to tell you what can and cannot happen. It sounds as though you've been reactive through all of this and not proactive. Maybe that needs to change.
Clearly, the company believes that if you cannot do the entire job, then you cannot do any of the job. And by you coming back over and over again with doctors' notes, it probably appears to them like you are just trying to find the right combination of words that will work. Now ... also clearly ... doctors' notes that note specific restrictions are allowed, since why tell you to get a doctors' note if such things don't carry any weight?
My suggestion would be to schedule a meeting with HR and relate your current health concerns, matter-of-factly. Explain that you enjoy your job and this company and that you want to continue. And then ask them what your options are. If you have no options, then there's your answer. If they say, "You must do all of the job or none of it", remind them that there is one segment of the job that you cannot do and then ask them what option you have if that part of the job is not available to you. If they say "You have no options, we're sorry", then you're stuck. But right now, you're kind of going in as the scolded child, trying to find the magic formula that will work to fix the situation. You need to go in as a responsible adult, fully aware of your limitations physically, and ask
them how to fix it. You may get no help at all, and then you're really no worse off than before. But then again ... they might surprise you.
Good luck!