All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
There is no contradiction between the verse and the Prophetic narrations which explain how the soul is taken away from the body and it being rewarded or being punished (in the grave). The verse was revealed as an answer to the question about the essence and reality of the soul, but the Prophetic narrations did not mention anything about the essence and reality of the soul.
The Prophetic narrations stated how the soul is taken from the body “It comes out as smooth as a drop of water would slide from the tip of a water jug” Or “It is taken out of the body like a skewer from a wet wool.”, and other similar narrations without mentioning the essence and reality of the soul.
Therefore, there is no contradiction between the verse and the Prophetic narrations.
Allaah Knows best.