@martin_stahl - But isn't that the point in learning theory? Deviations from theory are almost always sub-optimal moves, so you have a theoretical advantage as soon as your opponent goes off the beaten path.
Does this mean you will win? Of course not. Is it a substitute for concrete analysis? Of course not. Is it better than nothing? Sure.
@stil1 - again, not mutually exclusive. you can do both, and learning the refutation wastes less in-game time and you automatically play the most precise refutation.
Additionally, as I stated earlier, if you just follow opening principles against some openings, you're just going to get killed. This is most famously applicable to the Stafford Gambit or the Wayward Queen attack. If you play natural moves, you're going to lose.
Why do you think that most beginners complain so much about the Nelson bot? There's a reason why you see so many posts hating on him, and that's because they are playing according to the principles that they have been taught and they are getting mated in 15 moves. Sometimes it's just better to know before the fact what to do.
Certainly some theory is going to be learned in the process of trying to eliminate problems in games after you see them in practice, in a more organic growth of learning theory. You play a game, analyze it, and if you came out of the opening a lot worse off, find something better that works for you and that you understand. In that process, you can learn some of the more common traps or trappy lines, and hopefully remember it the next time someone plays it against you.
The problems with the learning theory are that most people end up trying to memorize lines and most of the games below a certain rating are going to reach a position you've never faced before, or that is been played as theory, in less than 10 moves, often within 6-7.
With a very few exceptions, most of the games I've ever played don't have a matching position in my previous games or any games from any database I have access to in less than 10 moves. If I don't leave theory, my opponent does and it often is in a way that is perfectly playable (doesn't create any major weakness to be exploited out of the opening).
Each move in any particular opening increases the amount of knowledge you need, since each move will likely have multiple potential replies and each one may rely on different theory/ideas. Unless your have a very good memory, then trying to learn all of that may be a poor use of time, especially when the players are normally losing the games to problems later in the game, regardless of how good they are out of the opening or how closely they hew to theory. Or a position is reached that isn't in your know theory that requires calculation and tactical ability more than any specific theory.