The Dead in Prison
Scholars have indicated that seeing a dead person in prison carries different connotations; if the deceased was a disbeliever, it might point to hell, whereas if they were a Muslim, it could mean being held back from paradise due to sins or unfulfilled obligations. As for a healthy living person seeing themselves in prison, it might suggest obstacles and hindrances for a traveler, and for a resident, it could signify entering places where sins might be committed.
Per Ibn Sirin's Muntakhab al-Kalam fi Tafsir al-Ahlam