Death is hardly understood. We have childish definitions about 'cessation of bodily functions' and so on, which are neither here nor there.
We can't use such definitions as a base to understand NDE's and other such phenomena.
Surely death is a process, and because of scientific and technological advancements we are able to disrupt that process more successfully than we ever could before. Obviously there comes a point in the deterioration and damage done to brain cells when we are no longer able to resuscitate, but we have found that that point is reached sometimes hours after a person has been named as 'clinically dead'.Hence the idea that the brain can continue to function in some way, at least intermittently, during this process is surely a fairly reasonable proposition. Recent research seems to show this as electrical activity within the brain.
As far as NDEs are concerned there is no reason to think that they cannot be classed as brain experiences and we have no knowledge as to when such experiences take place, whether they are at the point of unconsciousness, the point of revival, or during any active phase of brain activity in between.
The main sticking point is whether consciousness is to be regarded as a brain activity or something separate from the brain. All the evidence suggests that consciousness is a result of brain activity, even though we cannot yet define in scientific terms what the hard problem of consciousness entails. There is no evidence whatever to suggest that consciousness is something distinct from brain activity( as, for instance, in the analogy of the TV signal and the TV set).
Therefore there is no evidence and hence no reason to think that NDEs reflect or point to some type of afterlife. One can still hold such views, of course, but I would say that to hold such views is purely a matter of personal faith.