Where_am_I wrote:
Yeah, this happened a lot when I worked in the office. It only happened with very talkative colleagues, and I found it difficult to get away.
I said things like 'I'd love to stop and chat some more, but I really need to go or I'll get into trouble'. If they were colleagues I was comfortable around, I would end it abruptly and they would laugh about it.
Sorry if this isn't helpful.

Thank you for responding.
In my case, both of us want to end the conversation and go. However, weirdly we are both stuck in it. I always try to find a moment where I can naturally/comfortably/politely say, "Oh, I had better let you go. You must be busy. Sorry for keeping you here. Have a good day!" or something, but I seldom find one. I have a feeling that my awkward/weird/unpredictable mannerism/tone of voice etc is also making it hard for the other person to somehow find an excuse and end the conversation. We are both locked in the conversation.