Did you establish a trade route with a major player or a city-state? There seem to be a lot of exceptions regarding how trade-routes with city-states work as opposed to major players. Could also be, as Whoward69 put it, the "spaghetti" effect. Cost=-1 and Faithcost=-1 should lock out any civ being able to construct a building in the "normal" way. I usually include HurryModifier=-1 as an extra safety measure, but I'm not sure it's strictly necessary. I just assumed I would need it the first time I tried a hidden and /or dummy building, and since it was in there after I got everything to work I have always left it there since I always adhere to the "if it ain't broke..." approach. And completely hiding a building with XML-only relies on GreatWorkCount=-1 as you suspected. But of course as you firgured out, it only works for BNW. Irkalla discovered this code loophole -- he put up a tutorial on it some time back.