Try to call the function EndLooting(), this is what the vanilla game code does.
here is the vanilla code doing this:
https://github.com/esoui/esoui/blob/..._shared.lua#L8
Else try LOOT_SHARED:Hide()
here is the vanilla code doing this:
https://github.com/esoui/esoui/blob/...shared.lua#L48
But important, there is a comment: CloseLootWindow() -- Called when C++ is telling us to close the window. Don't call CloseLoot.
So normally this function will be called from non lua c++code and you shold not fiddle around it.
And the hide function's code:
https://github.com/esoui/esoui/blob/...shared.lua#L77
If you wonder why there always is used ZO_Loot_Shared: and I told you to use LOOT_SHARED:
Same as with the keybind.
ZO_Loot_Shared is the "class" and LOOT_SHARED is the object created via function :New to this class:
https://github.com/esoui/esoui/blob/...hared.lua#L199