Here is an troubling dilemma (formulated by Randal Rauser) that relates to some troublesome texts in the OT
(1) God is the most perfect being there could be.
(2) Yahweh is God.
(3) Yahweh ordered people to commit genocide.
(4) Properly functioning, moral adults have another powerful intuition that genocide is always a moral atrocity.
In addition, it seems very plausible that
(5) A perfect being would not order people to commit a moral atrocity.
(6) Therefore, a perfect being would not order people to commit genocide. (4,5)
(7) Therefore, Yahweh did not order people to commit genocide. (1,2,6)
So - how do we reply to this one?