Haven't used that api myself yet, but I think you need to call QueryRaidLeaderboardData first and can only do stuff after you receive the related event.
Lua Code:
EVENT_MANAGER:RegisterForEvent("MyEventHandlerNamespace", EVENT_RAID_LEADERBOARD_DATA_CHANGED, function()
-- do something here
end)
QueryRaidLeaderboardData()