This seems to work: pCity:SetBuildingYieldChange(GameInfoTypes.BUILDINGCLASS_LIBRARY, YieldTypes.YIELD_GOLD, 2), giving me 2 extra Gold per turn. When I try this, YieldTypes.YIELD_CULTURE, however, it won't update. The same seems to apply to Faith and Production.
Welcome to the weird, wacky and frustrating world of Firaxis (non-unified) yields.
In the beginning there were four yields - Food, Production, Science and Gold - these tend to behave consistently (although there are a few exceptions). Culture, while appearing to be a yield, was NOT implemented in the same way (and has no entry in the vanilla Yields table)
When G&K came out, Culture was promoted to a yield, BUT the implementation was incomplete - where culture was required by G&K (and later BNW) it works. If you're lucky, other secondary yield tables were hooked up at the same time to accept culture - but not all were. API methods that set yield bonuses are pretty much hit-and-miss as to whether they work or not for Culture - which is the issue you've discovered.
Then there's Faith - the illegitimate child of the Yields table! It's a complete mishmash of the standard yield and specific culture implementations within the C++ code, and, while appearing as a yield, suffers all the same issues as Culture - but when Culture will work, sometimes Faith won't ... and vice-versa.
Finally, there's BNW's Tourism. Implemented pretty much as Culture was originally, and most definitely not a yield.
...
Unless, that is, you're using a modded DLL that supports the
Unified Yields code base.