I was making a balloon entity that could be ridden, but occassionally I would not be able to dismount it by pressing shift. I would either have to disconnect or use /kill to escape. The message "Press shift to dismount" also displays on very few occasions.
I'm not entirely sure how to replicate it, but it seems to happen more often if right-clicked from a distance of about 3-5 blocks away, and I was able to recreate it in my Debug mod. This is all on single player, and the element is named DebugBalloon.
This can happen if the entity has too big bounding box in my experience.
I did not find a way around this to this point.