If conditions change so that an existing building would not now be buildable, the building vanishes on the next turn. For example, if an inquisitor has removed a rel from a city, all buildings that require that rel also vanish. If an event removes a tech from a player, all buildings that required that tech as a prereq vanish. If an existing building required a bonus to be built, and the supplies of that bonus are cut off, then the building vanishes.
For Civ4BtS 3.19, change sources included.