The story isn't flawed. One might choose not to believe it but there really isn't any error in its telling.
God says: Don't eat that, you'll die if you eat that.
They eat it anyway, they die and then He comes down to bring them back to life.
Where exactly is the flaw?
There are several.
One depends on god being omniscient and omnipotent. I'm not sure the bible itself tells us he is, but it's still a main feature of contemporary christianity. Such a god should have known in advance what would happen and was perfectly positioned to prevent it. If nothing else, telling A&E about the tree does imply he had knowledge of it. Even a limited deity should have been able to put up a fence - if you want a kid to not read a book, you don't leave it lying around.
The second is that the most common interpretation of the story has A&E learn about good and evil by eating from the tree. If so, how is it it just for god to punish two people whose sin is finding out that they shouldn't have sinned? They couldn't know going against gods command was wrong. It's like punishing a kid for reading a book that for the first time, ever, delivers to him/her the understanding that they shouldn't read.
Next, we don't judge people because their ancestors commited crimes; I can't imagine a more basic tenet to morality ... if we want to judge someone on his/her moral merit, we cannot judge them by someone else's. It's tautological. The story presents a concept of sin that suggests that moral corruptibility can be acquired by innocuous actions such as eating a fruit or simply being a son of Adam. (I can't help but wonder what would have happened if a boar had eaten from that tree. And yes, that is like asking what would have happened if Luke had not disabled R2D2's controlling device.)
Now the kid's future progeny will grow up knowing the contents of the book ... maybe. I'm not too sure what the biblical nature of humankind's corruption actually is.
The third is the nature of the punishment visited upon Eve especially. It's why childbirth is painful. Though somewhat random, hat's no problem in the context of the Eden story. It is, however, a problem if Jesus later lifts original sin from us because, well, women still experience pain during childbirth, don't they? Their punishment doesn't seem to have ceased. (Nor does it seem to me that all of christianity has taken this sin-lifting to heart.)
Now, the father is going to punish his grandchildren as well, for some form of hereditary corruption that they had no say or part in acquiring. But to make it alright again, the father will now reach into the cookie jar and present the kid with a cookie - as an act of forgiveness. (If you're not trinitarian, he'll send someone else to do it.)
And finally, just to go full circle, why would an omniscient god not have forgiven humanity then and there? Why wait? The implication being that god changes his mind - or worse, that he is willing to let his actions be dictated by wrath.