This is a misunderstanding about omniscience.
Omniscience sees all paths, yet allows choices. We do have free will.
But the choices here were a bit rigged.
First of all, Adam is made in God's image. Do you know what that means? It means that God effectively poured out the entirety of his Holy Spirit to make Adam. Adam is God, though it is more safe to say he is also not God but rather has God in him. He is God dwelling within clay, a hum-man ( "clay/soil" man). A human. Initially, Adam is a shemale or rather a two-sided human, but God splits a side ("rib" is a terrible mistranslation, rib refers to the side of a temple which goes left and right) and makes male and female. God also splits himself, light and dark, male and female, Yin and Yang. So God from the start is within a human who does not know he and she is God. He only knows God as a being apart from himself and yet somehow very familiar. So, secretly Adam will act according to plan, even though he thinks he is disobedient here.
God makes Eve as Adam's other half, and like Adam, she is God. Adam is obedient, while Eve decides using her mind what is best. Yet Adam also obeys his wife (God later turns this paradigm around, making Jewish society very patriarchal). God further stacks the situation by making the snake (as a created being, apart from human life, it is more like a symbol than the natural animal we think of today, in this case of wisdom and a mother's protective instinct; in fact some paintings give the snake Eve's face, implying that the snake was really her deciding and she blamed it on something else) tempt her and her husband.
There's also the fact that this Tree is at the center of the Garden. I want you to think of a curved wall. If you were to walk along it, you would never reach the end, and more importantly, you would have to hit the tree going in any direction. You would constantly see it, wherever you travel. It's also filled with fruit that can be reached not by a climb but branches well within reach. It's not guarded by anything either.
Assuming they did obey his command, he would probably have turned them back into dirt, because they were stupid. It is obvious that this is rigged, so either you disobey God here, or you disobey by not getting set up.