This is not actually a question of logic vs grammar; there is logic in grammar and there is also a matter of logic in the representation that grammar contributes to construct, and this representation can be from something in the real world or it can be entirely invented; but in this representation there are also concepts (first those found in words, then those that result from relations brought about by the combining rules of grammar); this is not grammar but semantics; the two have little to do with one another. In this latter the logic is on the level of how the representation relates to reality. If perceived reality shows some deficiency with respect to logic, grammar is foreign to this phenomenon, and, moreover it is indifferently put to use to represent that lack of logic, or illogicality, so to speak. It is "logical" to say that water runs from high level to low, yet while studying plants we are bound to say that liquids can go from low level to high: until scientists know that this is caused by a phenomenon called capillarity they are faced with apparent illogicality, and language must represent that, and they have to say "Liquids move from low levels to high.". It's an affair of semantics and truth. The semantics explains something that goes against the grain of everyday logic, and it is then a matter of adjustment of the semantics to show that both representations are true: the second is true in the light that there exists a bias, if we can thus refer to capillarity, that makes it true.
Further than that, the grammar can be put to use to describe in a perfectly logical manner an invented reality where nothing makes sense in comparison with the real world, and that allows the writing of the most far-fetched fiction.
A case of contradiction (apparent) is found in the real world: we have all been told in school that given a line there is only one parallel line through a given point and we think we have a sufficiently strong intuition that this is so, and yet, science tells us that this is only abstraction and that there can be more than one parallel line (hyperbolic geometry). There is not even any contradiction in the apparent formulations (there is only one line, there is more than one line); those statements are mere abbreviations, the system relative to which this is said must be made precise: in Euclidean geometry there is just one line, in hyperbolic geometry there are more than one.
In your example, the same argument applies: there is a system that is presupposed in each case and it is not part of each of the two statements, which makes them apparently contradictory, but they are not so because they are understood in the light of different backgrounds.
In the end, I think that you are speaking of a case of logic vs formulation; the apparent lack of logic is relative to an approximate formulation or an incomplete formulation, or put differently, an abbreviated formulation.
There is no problem of logic in either grammar or semantics in the following.
- Given the complexity of the problem, as I was intelligent, I had less trouble.
- Given that these examiners were prejudiced against people smarter than them, as I was intelligent, I had much trouble.