This is a strange behaviour I have noticed more than once now, and it can be reproduced whenever I whish on my pc.
I type some text in italics, then coninue without, but make a mistake (most often a forgotten comma).
I go back for one or two spaces, erasing what I typed (as it is not much).
With my cursor next to the word in italics, I press “ctrl+i” to remove italics.
I always do this before punctuation.
On the screen buttons, italics is then marked off, but where I type, it is still on.
When I turn off italics (on keyboard as well) and write pure text (without punctuation), this does not happen.
When I turn off italics on the button bar, even before punctuation, this does not happen.
And when I do not forget the comma and type straight ahead, this does not happen either.