Selam aleykum,
As mentioned, there's nothing like that in the hadeeth or qur'an. In fact this would contradict the many hadeeth that mention what does happen to the soul after death.
As for all those ghost stories, and stuff. Those are just djinns. And they try to fool us into thinking that it are the deceased. They do this, because if they get people to believe that the death still wander the earth rather then believing the truth, that they are waiting in their graves, receiving either temporary torment, or temporary reward until the day of judgement. Then by that false belief, they make people think that there's nothing to worry about.
If you believe that you'll wander the earth after death, then you'll prepare less for the afterlife, rather then when you believe you shall be questioned about your life, right? So this is just another trick from the shaytaans to try and steer people away from the true religion, and apparently some of this falsehood has even spread amongst muslims.