I am not sure why you lose the materials they should be Ok.
Maybe you are loosing your randomization. Or the UV’s.
Check this thread:
For randomization this answer:
If you are loosing the UV’s you need to use an attribute node with UVMap as attribute in the shader editor, Not the texture coordinate node. This is also discussed in that same thread.