What determines material order from Blender to FBX to UE?

I have parametric models created in Blender with (among other tools) Geometry Nodes.

In the models, I assign the material with an Assign Material node, and Blender establishes a material index corresponding to a material slot in the object properties.

I’ve made sure the materials are all in the correctly-ordered slots in Blender and that none are missing, knowing that if the Geometry Nodes assign a material that isn’t found in one of the object slots, that matarial won’t properly export.

When I export to FBX and then import to UE 5 (or 4.27), all the materials are created and even have the expected names and base colors. But they’re all out of order on the model. The model itself has material boundaries exactly where I expect; they’re just shuffled.

I’m at a loss to understand what else could control that ordering except for the material index, the ordering of the materials in the slots, and which faces have those materials assigned.

Can anyone give me a hint as to what happens downstream that might reorder these? I’m only passingly acquainted with 3D Studio, so I’m far from an expert on the FBX format’s internals.

I’m going to try using GLTF as an intermediate format to see if that helps, but in the meantime I’m hoping to understand what’s going on here.

Thanks for any suggestions.