In https://github.com/docker/libnetwork/blob/df3f8a10796e2173732aeafa41af45f970ced9f6/sandbox_externalkey_unix.go#L48 the code is expecting libcontainer.State as input but data provided by libcontainer actually has the type libcontainer/configs.HookState.
That means that this data doesn't contain netns path and the SetKey should not work.