Yes, you are right, the problem is with highlighting. But there is another undesired consequence - flyspell mode prevents `company` popup in this case, it appears only after second character is typed. I investigated it a bit and it seems it's caused by `sit-for` used inside `flyspell-check-word-p`. So I came up with a workaround that solves both these issues:
(advice-add 'flyspell-check-word-p :around (lambda (orig-fun &rest args)
(if (eq this-command 'self-insert-command)
(memq (get-char-code-property (char-before) 'general-category) '(Zs Zl Zp))
(apply orig-fun args))))
This makes flyspell return immediately when `self-insert-command` was used.