More on the subject. Revolution ON and Fixed Borders OFF. As supposed, AI is getting revolts in his city which is overwhelmed by my culture, so it decides to gift me the city and I get the popup.
Savegame here, usually after a couple of turns you get asked if you want that city to join your empire (if not, just use some spy - already there - to Aid Rebel Faction, which by the way is one of the most used Esp mission for AI). Either if you accept or you decline, city doesn't change ownership as it should, but you get a python error (
screenshot here). So either way there IS something wrong if revolting city is supposed to join your empire. Surprisingly, it works if that city breaks away to form a new civ. It happened to me a couple of time that the same revolting city founded Native Americans.