I think the important part is learning from what's gone wrong. Even big studios with hundreds of man-years of experience will look back at a project and find plenty of things to not like about how it wen't. The fact that you're having difficulties isn't a sign that you're too stupid for this, or that you're not cut out for it, it just means you've taken a journey into unknown territory and discovered a dead-end. Just back out and try another path. It can be frustrating, sure, but how many hard things in life can you expect to get from A to Z without making some mistakes along the way? This applies to life in general, not just programming. The trick, I think, is to find something you like doing enough that you're willing to put up with all the temporary setbacks. And it feels good to defeat those problems you've been having for hours, days, or weeks, when you finally get to claim victory, flip your computer screen two birds, and do your happy dance.
Besides, when you think about it, you often learn less from straight-line success than from failures. Experience is not all about knowing the happy-path, but also about knowing which paths lead to unhappyness. For example, if I'm sitting in a design meeting and some good-sounding idea is proposed, the person who's been down that path and can say with authority why its a bad idea is more valuable than the guy who's never ventured far from the happy-path and goes along with it because it sounds like a good idea. Success in most things is not about knowing where you're going, but knowing--or finding out--where not to go.