I have the same problem with the dictation icon. Sometimes I'll start typing a message and then realize that I'd rather dictate it. Once you start typing, the keyboard goes into "typing" mode. If you try to tap the dictation icon, it thinks you're aiming for the space bar.
I think that the keyboard is trying to be "smart" by altering its behavior based on what it thinks you'll do next. The problem is that those changes aren't reflected in the UI, so there's no way for me to know about them. I'm sure I benefit from that intelligence some of the time, but I only notice it when it when the keyboard stubbornly refuses to do what I want.