I don't know why it is happening.
Suppose I've got a code like this (let x be our cursor):
int main() {x
and then
int main() {
}x
Now I would like to enter the normal mode and type shift + o to insert a new line above }.
However this is what happens:
int main() {
}Ox
and after a while it changes to
int main() {
x
}
Here is a video where I was able to reproduce this:

Vim hangs for a second when typing shift-o after inserting curly brackets on YouTube
Side note: could you please suggest me better tagging for this question? I've got no idea how to tag it.
:set timeout timeoutlen=3000 ttimeoutlen=100. If so this question might be related: https://vi.stackexchange.com/questions/3261/speed-bump-on-esco-insert-to-normal-to-insert-new-line-above-cursor It's also a setting which is suggested in:help ttimeoutlen. – saginaw Jan 23 '16 at 21:23