First off, here's one thing to remember - you've made it as far as a master's level program - that alone is a level of achievement & of ability that already puts you ahead of a significant chunk of the population. Even if it didn't work out, the work & learning you've gone through thus far makes it anything but pointless, as will have accumulated a bunch more skills that you might imagine - a large part about higher level education is not just learning expertise in your field, but also in being trained
how to learn/organize. If you've made it this far, then you must already have picked up some of these skills & they, along with the experiences you've had, will serve to help you in the future.
You've done a great bit of self-analysis where you mention about trying to control all the possible outcomes - I know this thought process (too) well. Whilst it is logical to maintain as much control over things as possible, the trouble is (as you recognize), you can only take that so far - at some point it becomes like herding cats. Targets (whether they be having a gameplan for every possible scenario, or gaining certificates) are merely targets - sometimes it's just not possible to achieve them (or achieve them in the manner you originally anticipated). I'm not saying that you shouldn't have targets & take them seriously, but that recognizing the possibility that they may not be met doesn't make you a failure - it can instead take some of the self-pressure off & allows you to evaluate alternative outcomes that you'd otherwise ignore because they're not the original target.
Ultimately, all you can ever do is your best - sometimes it won't be enough, or life just gets in the way, but whatever happens you
will have learned something in the process & that will more than likely help you in the future. Nothing you've written indicates failure to me - failure would be if you'd
never tried & you've already successfully attacked that target by getting as far as you have done. May you have further successes!