Here's another opinion about the matter from islamtoday.net
A soul in the grave will be facing either Allah’s punishment or reward. This will occupy those souls so that they will not be disposed to going here and there. This being the case, my question is: How did Prophet Muhammad (peace be upon him) meet the Prophets on different levels I n the heavens during his Night Journey? Did the souls of those Prophets emerge from their graves on that occasion?
Answered by
Sheikh Nâsir al-Zahrânî
This question is basically concerned with the dwelling places of the souls after death. What we need to know is that souls dwell on different levels in the state of existence known as the Barzakh, the partition between this life and the Hereafter. In fact, there is quite a considerable disparity between them. Some souls will be in the highest ranking, such as the souls of the Prophets (peace be upon them). Even they will be in different rankings with respect to one another, as Prophet Muhammad (peace be upon him) saw them during his Night Journey. Other souls will be encased within green birds and will be able to go wherever they please in Paradise. These are the souls of some of the martyrs. Other martyrs while would be prevented from entering Paradise on account of an unpaid debt from their worldly lives. A man came to the Prophet (peace be upon him) and asked: “O Messenger of Allah, what do I get if I am slain in the cause of Allah? The Prophet (peace be upon him) said: “Paradise.” When the man turned to go, the Prophet (peace be upon him) told him: “Except for one with a debt. Gabriel has just now informed me.” [Sunan al-Nasâ’î (3155)] Other souls will be restrained in their graves. This we see in the hadîth where the Prophet (peace be upon him) speaks about a man who stole a small garment then was slain in Allah’s cause. He said: “I swear by Him in whose hand is my soul, the small garment that he stole is burning as a fire upon him in his grave.” [Sahîh al-Bukhârî (4234) and Sahîh Muslim (115)] Such souls that will be restrained within the Earth are souls do not rise to a loftier station degree because of their being baser and worldlier souls. After death, the soul will be with similar souls with similar deeds. Some souls will be in furnaces assigned for adulterers and adulteresses; others will be in a river of blood where they must wade with stones weighing down their mouths. There are many other circumstances as well. There will be in the Barzakh happy and unhappy souls, and that is why it will not be in one dwelling place. One soul may be in the highest of rankings while another will be in the lowest, basest ranking within the Earth. [For more information, refer to Kitâb al-Rûh (The Book of the Soul) by Ibn al-Qayyim] Knowing this, we can see that Prophet Muhammad’s gathering with the other Prophets in the ehavensduring his Night Journey poses no problem. The souls of the Prophets (peace be upon them) are in the highest dwelling place and not in their graves. I would also like to point out that the Prophet (peace be upon him) never said that the soul which are in their raves do not go here and there. On the contrary, he pointed out that the souls have different degrees in their dwelling places in the Barzakh. We should believe that the person after death may be experiencing pleasure or chastisement. There is no precondition that this pleasure or chastisement will take place in the physical locality of the grave. The meaning of “the grave” is the life of the Barzakh, Allah says: “Before them is a partition (barzakh) until the Day they are raised up.” [Sûrah al-Mu’minûn: 100] Since most people after their deaths are buried in their graves, this pleasure and chastisement are attributed to the “graves”. However, such pleasure or chastisement will be experienced by all souls, even those of people whose bodes were never buried. It should be known that the pleasure and chastisement of the Barzakh are not limited to the soul, as it is understood from the question, but are experienced by the body and the soul. The life of the Barzakh is one of one of the matters of the Unseen, so it should be not compared with the norms of our worldly life. We do not have any means to recognize how this other life will be aside from what the sacred texts tell us about it. And Allah knows best.