I'm pretty sure I've read Bible verses that say loved ones in heaven can't come back and visit and they don't know what's going on down on earth. I have a friend who says they had a near death experience and their loved one talked to them and now is visiting her at night. Did her loved one really talk to her and is her loved one visiting her at night?
It can be challenging to assess and evaluate near death experiences. Some causes might be psychological, emotional or medical (drug related). What is helpful in evaluating these experiences is recognizing whether or not they conflict with clear scriptural truths.
The Bible does tell us that when death takes place, the body and soul separate, and there is immediate judgment as the soul goes to heaven or hell (Ecclesiastes 12:7; Luke 16:19-31; Hebrews 9:27). We also know from the Bible that God controls the places where souls go at death (Luke 16:26). So, no, a deceased loved one would not be visiting your friend.