All knowing God didn’t know in advance what Abraham will do if he asked him to sacrifice his son. He had to test him to find out. Later he says “NOW I KNOW THAT YOU ARE A RIGHTIOUS MAN”
All knowing God Regretted a Great Deal for ever creating Humans.
The only logical need of God as portrayed in religion is to give people meaning/purpose in this meaningless/purposeless existence.
Otherwise, looking at everything critically, there’s no need of a creator as the universe is a self-creating entity