I am very sorry for your loss. You and your family have my deepest sympathy and support.
Well, its a very difficult question to answer. Sometimes, sand can move through the intestinal tract.
However, it can get easily impacted.
I performed a procedure in past year where I had to remove massive amount of sand impacted in the intestinal tract. That was after the pet already ate a ton of doggie poop bags. Yes, poop bags.
So, if stomach is in stasis and there is a severe impaction, I don't see really any alternative to surgery.
I don't know ultimately what the cause of death was or how long the impaction was present, but I don't think you should feel any guilt, at all, about the decision to pursue surgery under these circumstances.
I hope that information helps