I looked into this and I think I've figured out your issue.
When you send the message over IPC with
sendAsyncMessage, with the code as it is today, a warning is actually being logged to the console, it looks like this:
This error is produced if the attempt to StructuredClone your object fails. This is a warning, and not an error, for historical reasons (due to us trying to match the behaviour of MessageManager). When we fail to clone, and emit this message, the fallback is to try to serialize all objects as-if they were JSON. https://searchfox.org/mozilla-central/rev/40ef22080910c2e2c27d9e2120642376b1d8b8b2/dom/base/nsFrameMessageManager.cpp#417-434
There is some other object in your data parameter list which is not serializable, and so we're falling back to using JSON serialization, which doesn't handle nsIPrincipal correctly, which is why you need to manually serialize. Sending a
nsIPrincipal directly should work fine.