channel already hanged up
Then why do you want to hangup this channel, which (after hangup) does not exist anymore?
With that command, you can send a hangup request to a channel which still exists and you want to disconnect.
Maybe you are confusing the channels?
Normally, you have two channels: One from the caller, one from the callee. If one of these channels still exist, after either caller or callee hung up, you can only disconnect this one still existing channels (see “core show channels concise”) and get the correct name of that channel you want to disconnect.