There are a few reasons this may be happening, so I am going to provide a guess here. It is possible that the automation in the structure brings in all the issues, including the stories, using the Insert generator, and then when the story gets link to Epic, it is shown using the Extend generator as well. This particular situation is quite common and there is a special kind of Filter generator to resolve it, called "Remove Inserter/Extender duplicates". If you add this generator to your structure, then root level stories will disappear as soon as they are added under Epic. Please, try if it helps.
If not, then some additional description of the problem is needed - which generators are used to build the structure, where the duplicated issues appear exactly and how they are added to the structure - step by step.
ALM Works Support
Learn how to use two new reports for next-gen projects in Jira Cloud: Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events