For glTF importing there's an option that prevents Blender from merging material slots that share identical materials.
Could you also add this feature that maintains the original material slots for example after exporting as .fbx file? This is important for UE Editor.