"Set and filter HTML" (https://wicg.github.io/sanitizer-api/#set-and-filter-html) creates a DocumentFragment, which is the result of parsing the yet-to-be-sanitized HTML.
This fragment is part of the main document, which means elements that are added to it are created in the context of that document.
This can have side effects for things like image loading - an image loads at the moment it is created rather than at the moment it is connected to an active document.
A remediation for this would be to create that fragment in an inert document.