This seems to be related to the fact the material might be baked which requires a full rendering context. I recommend running the commandlet with `-AllowCommandletRendering` to avoid further issues. It should still work without a dedicated GPU. In this case, add -AllowSoftwareRendering which will consider the WARP adapter instead of using the more basic “Microsoft Basic Render Driver”
It appears you are not using a commandlet as the command line is missing the -run=XXX argument. In that case, you are starting the whole editor and AllowCommandletRendering won’t be useful. You can use -RenderOffscreen so the editor runs in headless mode (without -nullrhi).
I’m guessing a proper rendering context is required for GetMaterialResource return a valid material.
This seems to be indeed enough to get the merging done without the editor being fully displayed.
Still, would you happen to know why the rendering is even needed for this ? As I mentioned, bypassing that part of the test was leading to accurate results on my attempts. Is there any corner cases that could failed or is it (unnecessary) extra validation that could be removed as optimization.