Art by smbc-comics
Consciousness is often said to disappear in deep, dreamless sleep. We argue that this assumption is oversimplified. Unless dreamless sleep is defined as unconscious from the outset there are good empirical and theoretical reasons for saying that a range of different types of sleep experience, some of which are distinct from dreaming, can occur in all stages of sleep.
Pubmed Articles
Does Consciousness Disappear in Dreamless Sleep?
Sciencealert Article We Were Wrong About Consciousness Disappearing in Dreamless Sleep, Say Scientists
That is an interesting philosophical question.
If suffering is not remembered, was there even suffering? And if there was, does it matter? I can think of a few counterexamples of that, for example: a killer who tortures his victim before killing them.
Presumably in your scenario the victim remembers the torture though.
In the case of general anaesthetic the memory is effectively considered to be deleted in real time. On its way through the brain it ceases to exist so it never reaches the conscious mind.