The correct command, ever since the vanilla days, is “/ginvite ”. (There’s also a popup GUI window, but unfortunately that’s not relevant here.) If you enter just the “/ginvite” command and hit Enter early, instead of a useful error message you get this:
1x Blizzard_ChatFrameBase/Mainline/ChatFrame.lua:2168: bad argument #1 to 'Invite' (Usage: C_GuildInfo.Invite(name))
[string "=[C]"]: in function `Invite'
[string "@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:2168: in function `?'
[string "@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:5449: in function `ChatEdit_ParseText'
[string "@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:5101: in function `ChatEdit_SendText'
[string "@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:5137: in function `ChatEdit_OnEnterPressed'
[string "*ChatFrame.xml:140_OnEnterPressed"]:1: in function <[string "*ChatFrame.xml:140_OnEnterPressed"]:1>
Locals:
(*temporary) = nil
which is less user-friendly. (And nothing at all appears if they have scripting errors turned off.)
A reminder of the expected argument woulda been nice. (Popping up the GUI window to paste the playtname by shift-clicking their name link woulda been nicer, but that’s unlikely to change.)