IMO, It is not a bug but a desired behavior to add all the metadata entries for segments discovered including the overshadowed ones.
The coordinator should be able to handle multiple segment entries generated from insert-segment-to-db tool. Only load the latest one and mark overshadowed ones as deleted.
Isn’t that happening in your case ?
Also, Did you let the insert-segment-to-db tool complete before running coordinator on your new cluster ? If you didn’t wait it to complete, It might be possible that the coordinator starts loading segments based on a incomplete view and then when all the segment entries are made, it will drop the overshadowed ones.
Fwiw, If you consider the case when insert-segment-to-db skips the overshadowed segments, in that case the files will remain in deep storage always and there is no easy way to delete those files, leading to files leaking in the deep storage. If you want the tool to not add overshadowed segments, consider running a KillTask which deletes all the overshadowed segments before running insert-segment-to-db tool.