Q. Who should recite viduy with a dying patient, a rabbi that does not know the patient or the patient’s son who is there constantly with him?

A. It would seem reasonable that the patient would be less stressed and worried if his son, who is constantly with him recites the shema, viduy and other tefilos, instead of a rabbi who is a stranger he does not know. However, Horav Shlomo Miller’s Shlit’a opinion is that this may not be necessarily true and if possible, the rabbi should do it.
A rabbi when called, should also attend, not only because the inherent mitzva of bikur cholim, but also to provide support, guidance and counsel to the family in difficult times. It is also plausible that the patient may want to discuss and treat with a rabbi, even a stranger, issues that he would not want to address with his own children.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit”a