Any card that gets a bonus from devotion or experience, for example demigods, lose the constellation bonus and kills them.
Up to a point. There seems to he a limit where my demigods stopped dying. There is definitely a math error in your code.
Here is a video showing the issue:
https://photos.app.goo.gl/qYgc8uATPg9J4E3G6