Genesis 2:17 shows that G-d gave Adam clear warning not to eat from the tree of the knowledge of good and evil, that there would be severe consequences if he did so.
But Adam disobeyed and the rest is history.
Well,the premise is the same as Pandora’s box.
And the question is why place temptation if you,the all-knowing one, already know the tempted one will fail the test.
They didn’t die.