I think the bug happens because there is a special situation when you have built 1 city and 5 settlements and then loose a city. In the physical board game you just lay the city on its side and treat it like a settlement. If you want to build cities later in the game you first have to upgrade this "special settlement" (i.e. the lying city) to a city before you can upgrade any other settlement to a city.
Here on BGA you will probably see 6 settlements in such a case (I have not checked it myself). But the programmer has to keep track which of the settlements is the broken city. There are instances where settlements are shown but they are lying cities (i.e. a half settlement/half city state) and I assume that the programmer did a mistake trying to keep track.
Please note that the bug usually occurs in a different situation. But it is always (?) when you lose a city by the barbarians and rebuild it later.
Edit: It seems like the bug happens in exactly the following case:
*) City gets pillaged by barbarians
*) You build 5 settlements
*) Only then you upgrade one settlement to a city
*) Now you have 1 city and 4 settlements but you dont get a settlement back
*) If you upgrade another settlement you have 2 cities and 3 settlements and no settlements to build