Hi @Sridhar - it sounds to me like a timing issue, I.e. KM is sending the first keystroke before Notion is ready to accept it. So I would try increasing the duration of the first Pause action to, say, 0.5 sec or more and see what happens.
On my Mac there are some apps that, even though they come to the front they still take a while to become responsive!