The Catechism of the Church states that souls after death go to heaven, hell, or purgatory. Souls do not just go wandering the world as an alternative fourth path, as that is not one of the choices offered.
It is possible that God in his mercy might allow a soul to manifest on earth in some way for God’s purpose. For example, St. Padre Pio reported seeing deceased souls who manifested to him asking for his prayers, thanking him for prayers he had already said for them, or serving their purgatory on earth by doing some assigned task. It is important to note that these souls were in purgatory, which according to the Church is a state of being and not a physical location, so they were able to physically be on earth if God willed it, while still being in purgatory.