I understand what you are saying and tend to agree with you. However, I do not discount the appearance of a dying person's loved ones at the time of death or sometime before to be demonic. I believe that God can allow anything to happen and that He knows what will ease and comfort His own better than we.
I do agree that God can allow manifestations of all manner of things CONSISTENT WITH HIS NATURE AND PRIORITIES . . .
Some things He seems to wholesale prohibit in Scripture. I doubt He'd be likely to do at least some of those prohibitted things.
Yes, I believe He has sent images of departed loved ones for comfort.
I think images is a more correct term than ghosts. God is better at virtual reality than we are.