I'd register a callback function to this event to start your code as the guilddata is ready:
https://github.com/esoui/esoui/blob/...shared.lua#L35
Lua Code:
local function OnGuildDataReady(guildId)
...
end
GUILD_BROWSER_MANAGER:RegisterCallback("OnGuildDataReady", OnGuildDataReady)
This is how the ZOs code does it.
Create your own callback register and use e.g. anoher local function MyOnGuildDataReady, and in there do your checks on the guilddata. This should strip your "wait some time" code as it shouldl fire as your requested guildData IS ready.
Maybe this will already fix he 0 issue then.
btw: Did you check the guildId is correct and given? Maybe it is 0 itsself and thus the function returns 0 ?
Guild size data:
https://github.com/esoui/esoui/blob/...nager.lua#L199
Maybe this helps and returns another value (which would make me wonder) GetGuildSizeAttribute(guildId)