Thanks for the report. This is a known bug, logged as RH-69273. A headless document reads the render content from the file, but the RenderMaterials, RenderEnvironments and RenderTextures tables never get filled in.
Until it’s fixed, File3dm.Read is the reliable way to get at the render materials, as you found.
Thank you very much for the quick reply. I understand that this is a known bug.
I am currently developing a plugin that relies heavily on headless open / edit / save operations, so this issue has a fairly significant impact on the workflow. For now, I have changed the plugin to use normal open/save instead.
I would really appreciate it if this bug could be fixed when possible.
As always, thank you to the McNeel team for the quick support and for continuously improving Rhino.