I've noticed it in a few games, and just confirmed. It usually happens when one AI takes over another AI's cities, and I had an open borders pact with the cities' former owner. The game will let me move units through parts of their territory near the cities they conquered even without an Open Borders treaty.