1) Both are in the channel.
2) User B kicks you.
3) Userr B kicked you, you are out of the channel, and then mIRC gets informed.
4) You try to re-kick, but can't, since you are no longer in the channel.

So, solution would that you save the kickers nick, and try to kick him once you regain op status again.