The question presupposes that domestic cats know when they are dying. The well-known Dr Desmond Morris (a zoologist who I completely trust) believes that cats don’t know what death is. If that’s the case they won’t know when they are dying which means they don’t go away to die.
However, cats do go away to quiet places if they are injured or frightened. Having been injured and hidden in a quiet place they might die there because of the injury. This may give the impression that the cat has gone away to die.
I had thought that cats might go away to die when a female cat that I loved very much was hit by a car on the road outside my house. It happened at night so in effect she disappeared. When I came back from work she wasn’t there so I knew something was wrong. I searched for her. I found her under some low branches of a tree not far from the road. She was dead, and I died inside. She must have run there after being hit as a quiet place to hide; to hide her injuries and to recuperate but she passed away.
There was a time when I believe that cat should be given the chance to roam freely outside. Nowadays I don’t believe it and have built a rather nice garden enclosure for my cat.
So in answer to the question in the title: I don’t believe that domestic cats do go away to hide. There will be many examples of cats dying in full view of their owner (due to poisoning for example) or in open places. And if a cat has got lost and subsequently been injured then this is not an example of a cat going away to die but of a cat that was lost and who was injured and possibly killed.