GetTotemInfo(slot) will return a lua error for any value that isn't 1-4 (assert function or similar). By extension GetTotemTimeLeft(slot) will return the same error. This also means that the UI will not display more than 4 active totems at any single time.
Whilst this is a non-issue for the vast majority, restoration still has enough totems to run into this problem should they decide to drop all 6 totems *whilst* using an addon that calls this function. And this doesn't even take into consideration pvp totems, which may also cause elemental shaman to run into this same issue.
The base UI is simply coded to MAX_TOTEMS, and thus ignores any value in excess.
Typical lua code for any addon using this function and totem update events.
function addon:PLAYER_TOTEM_UPDATE(event, ...)
local slot = ...
local _, name,_, duration, icon = GetTotemInfo(slot)
local _,_,_,_,_,_, spellid = GetSpellInfo(name)
-- do stuff
PLAYER_TOTEM_UPDATE sends slot information greater than 4, so using that event for GetTotemInfo(slot) is the prime cause of this error occurring.
The API works for 1-5, but yes you can put up to 10 Totems down at a time so this is clearly a problem.
They fixed the API around 2-3 weeks ago. There's also a cap to the number of active totems you can have out. Not entirely sure when the cap was implemented, but the same patch I noticed the API was fixed was when I noticed the cap.
Shaman can have a maximum of 5 totems active at once. Any new totem that is cast whilst 5 are active will destroy and replace the totem with the shortest duration remaining.