Right to healthcare when sectioned

Is there anything in law that provides protection to someone sectioned under section 3 of the mental health act so that the person can receive general healthcare that someone who isn’t sectioned can get access to?

Aspects of my father’s health were neglected when he was sectioned. But most importantly he was prevented access to the COVID vaccine when invited to attend for it by the NHS. Then he caught COVID and died from it. Rather ironically we found out after his death his detention was invalid due to the high court judgement about remote assessment.

So we could have taken him for the vaccine ourselves in hindsight.

To provide a complete answer I would want to ask two questions.
Q1. Is the reading of the first paragraph that the RC refused to administer the Covid vaccine.
Q2 in paragraph 2 does preventing mean that leave under for example s17 was refused.

I can see why an RC might refused to allow a person detained under S3 to leave the facility but was that the extent of the prevention. I can also see why administration of the vaccine might be deemed unsuitable because the risks exceed the benefits in a particular case.