The method widget.removeListItem(widgetName, at) uses 0-based indexing instead of the Lua-typical 1-based one. I.e. deleting the first item of a list requires at = 0, which is inconsistent with regular Lua behavior.
I forgot which API function it was but something related to list items is (or was) literally negative 1-based. This likely won't be fixed so it's just something you'll have to deal with.