Friend information isn't necessarily automatically kept up to date. You can use C_FriendList.ShowFriends() to request an update from the server.
Example
localf=C_FriendList.GetFriendInfoByIndex(1)print(format("Your friend %s (level %d %s) is in %s",f.name,f.level,f.className,f.area))-- Your friend Aërto (level 74 Warrior) is in Sholazar Basin