Jiro has already responded on the central question (with a point that I had already made, but it bears repetition, and apparently keeps being missed when I say it, so my thanks to Jiro). The following is re: other issues mentioned in your comment.
Other GMs introduce logical puzzles into the mix. In this case, while your character may be perfectly balanced for combat, it is still possible to lose due to failing to figure out the puzzle.
Yes, but how does being ineffective in combat help you figure out the logic puzzle? Answer: it does not. Therefore: a character who is effective in combat, played by a player who is good at logic puzzles, is strictly superior to a character who is bad at combat, played by the same logic-savvy player. In other words: in this scenario, being more effective in combat makes you more effective at D&D. (Unless there is literally no combat. Ever. In which case, why are you playing D&D? Other systems are far better suited to your needs.)
Still other GMs prefer to tell a story. In this case, the game is less about killing things, and more about pretending to be a person living in a magical fantasy world... A person who, on occasion, kills things. ... The GM is not, of course, obligated to keep you alive; but at least your game will be interesting.
The long-running campaign that I DM is heavy on roleplaying, plotting, and political machinations. I haven't run a straightforward dungeon crawl in that campaign in a long time (I generally reserve that for one-shot adventures). We sometimes go a session or two without combat entirely; combat is certainly not the central focus.
However, all of the player characters are heavily optimized and frighteningly lethal in combat. If it comes to it, they dispatch enemies with ruthless efficiency.
Why?
Because roleplaying effectively, or having your character be interesting, in no way precludes being effective in combat. Being combat-effective loses you nothing as far as logic-puzzle-solving, story-telling, roleplaying, being interesting, etc., etc. And because even if combat is not the only challenge, or the most common challenge, it's certainly a challenge; and being less effective at solving certain challenges... makes you less effective overall.
Again: if you do this knowingly and deliberately, and you and your party-mates are ok with that, fine and well.
Because roleplaying effectively, or having your character be interesting, in no way precludes being effective in combat.
This is not, strictly speaking, true. Most gaming systems -- even D&D -- encourage you to tie your roleplaying to your stats at some point. For example, our hypothetical crossbow-Wizard might take Point Blank instead of Spell Focus (or some similar Feat); this is a real tradeoff, since the number of Feats you can take is limited. A Rogue (or, indeed, any character) might spend his points on Diplomacy, Appraise, Knowledge and Profes...
There are things that are worthless-- that provide no value. There are also things that are worse than worthless-- things that provide negative value. I have found that people sometimes confuse the latter for the former, which can carry potentially dire consequences.
One simple example of this is in fencing. I once fenced with an opponent who put a bit of an unnecessary twirl on his blade when recovering from each parry. After our bout, one of the spectators pointed out that there wasn't any point to the twirls and that my opponent would improve by simply not doing them anymore. My opponent claimed that, even if the twirls were unnecessary, at worst they were merely an aesthetic preference that was useless but not actually harmful.
However, the observer explained that any unnecessary movement is harmful in fencing, because it spends time and energy that could be put to better use-- even if that use is just recovering a split second faster! [1]
During our bout, I indeed scored at least one touch because my opponent's twirling recovery was slower than a less flashy standard movement. That touch could well be the difference between victory and defeat; in a real sword fight, it could be the difference between life and death.
This isn't, of course, to say that everything unnecessary is damaging. There are many things that we can simply be indifferent towards. If I am about to go and fence a bout, the color of the shirt that I wear under my jacket is of no concern to me-- but if I had spent significant time before the bout debating over what shirt to wear instead of training, it would become a damaging detail rather than a meaningless one.
In other words, the real damage is dealt when something is not only unnecessary, but consumes resources that could instead be used for productive tasks. We see this relatively easily when it comes to matters of money, but when it comes to wastes of time and effort, many fail to make the inductive leap.
[1] Miyamoto Musashi agrees: