I've never had the game interpret the table in that manner but it might be because of the combination of the MutuallyExclusive buildings at the end of the prerequisites chain and the disparity in the prereqs chain between those two buildings.
__________________
I have made the game lock up completely by the structure of a Prereqs-Chain, however.
Before R&F you could make a building its own prerequisite and thereby lock the building from ever being buildable or purchasable so it could only be acquired in a city by a Modifier or by an lua script. The alterations to the game DLL from R&F simply made the game go into a hard-lock when a city was founded and there was such a 'self' prerequisite setup in table <BuildingPrereqs>.. Took me quite a while to find the cause since the game never made any database errors -- just locked upon founding the first city in the game because the lua script that is used for the City ProductionPanel could not get "answerback" from the gamecore for the list of valid buildings the city could construct.
___________________
Also, when a Building is listed as a replacement in table <BuildingReplaces> you don't need to list it separately as a prereq for other buildings. I don't think there is any negative impact or altered behavior of the game if you do so, but it is not needed. Stave Church, Madrasa, Film Studio, etc., are not listed as prereqs for the Religious Buildings, the Research Lab, or the Power Plant buildings. The game will automatically equate the Replacement as being the same as the building it replaces. However you still have to list in a separate row the prereq for the replacement building.
Copy/Paste from a discord convo:Consider the contents of this table from the Vanilla Buildings file
Code:
<BuildingReplaces>
<Row CivUniqueBuildingType="BUILDING_FILM_STUDIO" ReplacesBuildingType="BUILDING_BROADCAST_CENTER"/>
<Row CivUniqueBuildingType="BUILDING_MADRASA" ReplacesBuildingType="BUILDING_UNIVERSITY"/>
<Row CivUniqueBuildingType="BUILDING_STAVE_CHURCH" ReplacesBuildingType="BUILDING_TEMPLE"/>
<Row CivUniqueBuildingType="BUILDING_ELECTRONICS_FACTORY" ReplacesBuildingType="BUILDING_FACTORY"/>
</BuildingReplaces>
Then consider the contents within the same file for table <BuildingPrereqs>. Here we see both the Temple and the Stave Church needing a Shrine:
Code:
<BuildingPrereqs>
<Row Building="BUILDING_TEMPLE" PrereqBuilding="BUILDING_SHRINE"/>
<Row Building="BUILDING_STAVE_CHURCH" PrereqBuilding="BUILDING_SHRINE"/>
But we never see any of the Tier 3 Religious Belief Buildings requiring a Stave Church
Code:
<Row Building="BUILDING_CATHEDRAL" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_DAR_E_MEHR" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_GURDWARA" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_MEETING_HOUSE" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_MOSQUE" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_PAGODA" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_STUPA" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_SYNAGOGUE" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Building="BUILDING_WAT" PrereqBuilding="BUILDING_TEMPLE"/>
Similarly, we see that the Madrasa requires a Library (like the University the Madrasa replaces), but nowhere do we see the Madrasa listed as a Prereq for the Research Lab.
-- end copy/paste
For a replacement building you should ensure it is linked to a TriatTtype that is then linked to a Leader or Civilization Trait to ensure the game properly parses how to handle the Prerequisites when another building requires the Default building as a prerequisite.