Re: “how do you comfort the broken heart in this case?”
Funerals are done all the time where the minister does not personally know the deceased or even the family all that well or not at all - but for whatever reason, they came to you to officiate the funeral of their loved one. If you determine that the diseased was probably not a Christian, you focus on the Gospel, that all of us will face death and judgement, but in spite of our sin there is hope for us through the death, burial, and resurrection of Jesus Christ.
In other words, you focus on the needs of the living - and what they need is the Gospel.
You never know who will be in the audience and as human beings, we do not know the eternal destiny of anyone except ourselves - none of us knows the hearts of anyone else except God alone. That is why only He can make eternal judgements.
If I were the pastor. I believe I could officiate the funeral. Either a graveside service or at a funeral home.
But NOT at the church. To conduct a queer funeral at the Lord’s house would be profane.