If the priest was giving last rites, then I am assuming (yes I know the risk) that this patient wanted to confess, repent, and be right with his maker. (though I must admit I have seen and heard of more cases of last rites being done on folks very very near death and mostly non-responsive).
Sounds to me like this ‘patient’ was looking for a way to make a statement that had nothing to do with his eternal salvation
The patient bragged to the priest about being an unrepentant homosexual and then cursed the priest. That is not someone who wanted to confess and repent.