This is not a bug, it's a normal way that word processors behave. I'm able to replicate the same issue with MS Word. The problem is, when we place the cursor right before a word (no space), press Cmd–I and start typing, Pages acknowledge that we want to italicise the word that we're currently typing on it. But after the new word, we press Cmd–I again
without adding a space to it, Pages will think that we want to de-italicise the
current word, hence the 'changes back to roman' – but the italic option is still turned on (if you notice on the Format Bar). So if we add a space now, and start typing again, the next word will be italicise (again).
Hope this clarifies. If we want to add something in the middle of two words, it should be a habitual practice to place the cursor at the end of the first word, add a space and start typing; and not placing the cursor at the beginning of the second word.