Foliage doesn't spawn when copying meshes

In 4.19, Foliage can auto spawn when copying meshes. But after I updated my engine to 4.21, it doesn’t work.

So I read the code and found that when the new actor was spawned, foliage instances were added in a Map (InstancesInvMap) using the soft object pointer as the key. Then, engine changed the actor label, so the actor’s path has been changed and caused the soft object pointer in InstancesInvMap became null.

Then I spawn an a cube with foliage attached on it and I changed the actor’s label. The foliage didn’t follow the cube when I moved it.

I think this is a bug.