The loot table works as intended in 1.13.1 official release single player testing.
When upload to the Realm server, the portion of the loot table related to set_nbt is ignored.
The specific case revealing bug is this custom minecraft/entities/potions loot table. The set nbt portions are ignored, and the loot is just the default empty potion bottle.
Since set_nbt is ignored on Realm server, written book loots don't work at all on Realms (but do in single player), dropping nothing on Realms, given that books depend entirely on set_nbt.