I am trying to mate a gear with a shaft via a key.key coincident with gear and cocentericity of gear with shaft cannot both be made.
Your issue is that you're assuming the key and key way will have exactly the same dimensions. In reality the key will have to be slightly smaller than the keyway.
What yo want to do is start with the concentricity, then use the width, or parallel mate to line up the key and keyway. This way you're not over-constraining the assembly.
Solidworks sometimes lets you get away with that, but even when it does it's not a great idea and it can break unexpectedly later.