The error message says: string expected, got table. Name should be a string but somehow it's a table.
Why is that? C_FriendList.GetFriendInfo(Name) returns a table with a bunch of info:
https://wow.gamepedia.com/API_C_Frie....GetFriendInfo
If you just want the name you can use C_FriendList.GetFriendInfo(Name).name