That's brutal they'd execute the stand-in after the celestial omen was deemed to have passed. I wonder if the person standing in knew it was coming? Was it a great honour to take the king's place during a crisis, or was the person put there in a more deceptive way?
In pre-scientific societies, "let's just murder a bunch of people and see if it helps" seems to be a surprisingly common way of handling all kinds of things. Google "Children of Llullaillaco" for an absolutely heartbreaking example of this.
Those societies were usually operating in a state of Malthusian equilibrium. There were always surplus people around who were going to die anyway. Culling this surplus was a problem they constantly had to solve; I imagine this drove warfare, for example, just to use some of the surplus before it inevitably died off in a lean year.