Yep.
That's also how dissociative sedation works. You don't remember being sedated, and you are not (psychologically) traumatized by medical procedures happening during it. I had it several times for minor oral surgeries, and it's great.
And the modern ECT is also done under deep sedation.