Spoilers
Alex's death was inevitable from the very beginning of the story. He had been thinking about suicide for a long time, and the ritual was his last attempt to find meaning in this life, but unfortunately, it was exactly this ritual (specifically, the demon's leaving) that became the last straw that led Alex to commit suicide