detach() is not to blame here.
You're performing a copy of the container element's inner markup, and you're detaching the elements created from that copy. These elements are not part of the DOM to begin with, and will indeed not have any handler registered on them.
Try writing:
var detachedContent = container.children().detach();
Instead of:
var content = container.html();
var detachedContent = $(content).detach();