Scattering objects through geo nodes breaks materials. Is there a way around it?

In particular it breaks UV maps.

I’m trying to scatter instances of an object that uses 3 materials, one of which contains UV mapped textures. Instancing the object through geometry nodes breaks that material, making it one plain color instead (probably sampling from a single pixel of the texture). In LuxCore it seems to be half-working when I use other forms of mapping instead (like box mapping) at least, but that’s not sufficient.

Is there a way to work around this and instantiate objects through geometry nodes while keeping the materials intact or setting them up inside geometry nodes as they were? The “Set material” node doesn’t seem to provide a solution either since the UV problem stays and the object uses 3 different materials.

Answer: Realize Instances node is the cause of this. For some reason several tutorials for object scattering through geometry nodes include it in their node sequence without really explaining why.

It’s not necessary for the scattering to work and it breaks UV maps, without it everything works as it should.