Yes, I pointed out this bug several versions ago with the Mercurians. The example I used was the Catacombs Libralus. Basium took over the city with that wonder in it, but still had to build a Mage Guild to build Adepts. Likewise, none of the other Mercurian cities had Mage Guilds and had to build them.
There are still quite a few bugs outstanding with the Mercurians, but I'm sure the development team has higher priorities to work on for now.
Because it's still linked to whoever built it. Not whoever owns it...
EDIT: after some debugging, I believe this is caused by the owner losing the city, thus the free building and specialist bonus but since the Mercurians are in the same team, they lose the bonuses too. But this is after Mercurians getting the city AND the bonuses. Thus making them lose the bonuses straight after gaining the bonus.
Better/Correct illustration of the problem (I suck at languages, sigh), consider only changeFreeBuildingCount:
Right after original owner loses city and Guild of Hammers, iChange = -1:
Owner:
iOldFreeBuildingCount: 1
after m_paiFreeBuildingCount[eIndex] = (m_paiFreeBuildingCount[eIndex] + iChange);
getFreeBuildingCount(eIndex): 0
forges are removed
Basium:
iOldFreeBuildingCount = 0
after m_paiFreeBuildingCount[eIndex] = (m_paiFreeBuildingCount[eIndex] + iChange);
getFreeBuildingCount(eIndex): -1
causing FAssertMsg "getFreeBuildingCount(eIndex) is expected to be greater than 0" shown
But since the loop to add forge to every city runs when ioldfreebuildingcount is 0
Basium's cities get free forge for now
After Basium gains city and Guild of Hammers, iChange = 1:
Owner:
iOldFreeBuildingCount: 0
after m_paiFreeBuildingCount[eIndex] = (m_paiFreeBuildingCount[eIndex] + iChange);
getFreeBuildingCount(eIndex): 1
forges are added
Basium:
iOldFreeBuildingCount = -1 WTF? STILL -1 even though there is a forge in the city
after m_paiFreeBuildingCount[eIndex] = (m_paiFreeBuildingCount[eIndex] + iChange);
getFreeBuildingCount(eIndex) = 0
else if (getFreeBuildingCount(eIndex) == 0)
{ ... } is run
BASIUM LOSES THE STUPID FORGE