list details = llGetObjectDetails(llGetKey(), [OBJECT_GROUP]);
string name = llKey2Name(llList2Key(details, 0));
llOwnerSay("["+name+"]"

The llGetObjectDetails call returns a one-element list containing the prim's group key. The key appears to be a valid key, but passing it to llKey2Name() always returns an empty string (i. e., the llOwnerSay always outputs []). I have verified that the prim DOES have a valid group set for it. This is a regular single prim. It is not part of a linkset. It is not an attachment.
Anyone know why this is not working? Thanks!!