A nursing home is considered private property and if the nursing home deems you a problem then the nursing home can trespass certain people from the property so then they would not be able to visit the patient.
But the nursing home would have to call the police and have you trespassed from the property.
But nursing homes cannot just ban visitors that the nursing home patient has a right to see.
Nursing homes cannot legally place limitations on the residents rights to have visitors to the nursing home unless the patients doctor puts it in writing that a certain visitor would be harmful to the nursing home patient.
So you can visit the nursing home resident even if the nursing home thinks you should not do so and if they try to stop you then the police can be involved to allow you in the nursing home to visit.