God
Why did God create me if he already knew every mistake I would make?
Knowing something will happen isn't the same as making it happen.
If a friend who knows you well predicts exactly how you'll react to bad news, their accurate prediction doesn't cause your reaction—you still do it freely. Foreknowledge and causation are different things, even though it's easy to blur them together.
That distinction matters here. God foreseeing your failures doesn't mean God wanted or authored them. It means God chose to create a world with real freedom, knowing what some people would do with it—including you.
Why create that kind of world at all? Because a world where love and goodness are freely chosen is worth something a world of pre-programmed non-choices isn't. Freedom that can be used badly is the same freedom that makes anything you do right actually mean something.
And your failures weren't a surprise God had no plan for. The remedy for exactly this—forgiveness in Christ—was never an afterthought.
Bible quotations in these answers are generally taken from the Christian Standard Bible®, Copyright © 2017 by Holman Bible Publishers. Used by permission. Christian Standard Bible® and CSB® are federally registered trademarks of Holman Bible Publishers. Some biblical wording may be paraphrased or follow other translations.