Very good question.
The traditions about the torment in grave indeed pose a great question as they seem to be in direct contradiction to science. The torments are said to be bodily in particular. So it's just not that there's torment that can be said to affect only the soul. There are bodily pains felt just as punishments and rewards in hell and paradise are said to be bodily.
Now we know the body stops feeling anything upon death. Science tells us the brain and the nerves are instrumental in sensations and consciousness, and should they stop working there will be no feeling and consciousness.
Now how to get around this apparent conflict between science and religion?
If you think about it, you'll see that there's really no way around this unless by postulating that we probably have other bodies that don't perish upon death!
But the question is what do we have in way of religious, scientific or experimental evidence to confirm that this theory is really the case?
The analogy you have quoted from al-Nawawi is very useful here. There's actually a Quranic hint that helps us with understanding what happens upon death by an analogy to sleep.
Allah in the Quran says that He takes away the people's "nafs" (self or soul) upon sleep and then returns it back when they wake up. But when they die He doesn't return the soul! Here's the text of this very significant verse:
It is Allah Who takes away the souls of people at the hour of their
death, and takes away at the time of sleep the souls of those that
have not died. Then He retains the souls of those against whom He had
decreed death and returns the souls of others till an appointed time.
Surely there are Signs in this for a people who reflect. (39:42)
This is a very key statement as it points to a fundamental similarity between sleep and death: under both conditions the soul is "taken away" by Allah.
But the important thing is that, we do keep thinking and dreaming during sleep, right? -- which only confirms that human consciousness is not necessarily dependent on the body and the brain under all conditions.
If there remains a question that how can people sustain vegetative life during sleep if their soul is taken away, the answer is that the soul is taken away during sleep but not in full! In other words there are still some strings attached. A more technical answer, based on the doctrine of divisions and faculties of human soul (e.g. vegetative soul, animal soul, rational soul), would argue that during sleep only the rational soul and probably also animal souls are taken away but not the vegetative soul. See this extensive answer for religious confirmation of multiple subsidiary souls in humans.
Now by further reflecting "the signs" in sleep, we arrive at an even more interesting observation which confirms our hypothesis: we do seem to have bodies, dream bodies, during dream, don't we? And we do sense and observe things during dream by our dream body? Right?
Eureka! The riddle seems to be solved now! We are always embodied creatures, even in our dreams and even after we die! This explains why pains and pleasures in afterlife whether in the grave or in heaven and hell can be quite physical and bodily. It only happens that these other bodies are subtle, reside in other dimensions and are invisible to our physical eyes but they appear to us as quite concrete physical things when we experience them in other dimensions.
Now do we have non-scriptural evidence that braodly confirm this? Yes, we do!
- Mystics from all religions have reported subtle bodies that accompany humans in higher/other dimensions of existence.
- People with near-death experiences and out-of-body experiences report finding themselves in other bodies during the experience of living their natural body.
- And the rare special good news is that there's a rare group of dedicated scientists specializing in study of paranormal phenomena who confirm the supernatural reality of such experiences and are strongly persuaded that consciousness survives bodily death and can operate independently of the brain. Watch this public presentation by scientists from Division of Perceptual Studies, the Department of Psychiatry and Neurobehavioral Sciences at the University of Virginia.
Are there Muslim scholars who held this view with full certainty? Yes, many Sufis as well as Shia scholar-metaphysicians (a famous case being Ayatollah Khomeini) adhere to this belief. Mulla Sadra, a 17the century Muslim metaphysician, mystic and scholar was first among Muslim thinkers to establish the doctrine of subtle bodies in afterlife by rational and religious arguments.
There can be still some minor questions left like how the person is said to experience those torments or pleasures as if in his physical grave but maybe I answer them next time.