This has been an issue (for me) since Civ IV. If you are using WASD/arrow keys to rotate when a forced message pops up, it inevitably gets stuck in the direction you're scrolling. As you said, sometimes clicking randomly fixes it, but still annoying.