There is an issue with how layer duplication currently works, and I got myself confused. However, an Adobe employee suggested submitting this as a new Idea.
The Idea
Either make the duplicates appear under the original by default, or create a checkbox that enables this behavior in the Properties. Alternatively, add a separate command/hotkey (e.g., Alt+D). It would be even better if users could also specify how many layers to duplicate, perhaps on a dedicated panel/tab. Additionally, please add the missing condition check that causes the issue.
The Issue
The issue impacts the attached Effects that contain pulldown attributes for layer selection (propertyValueType == 6421), e.g., SetMatte or CC Composite. If that property points to its host layer (i.e., self, index n) and the layer gets duplicated, the host layer moves one position down to index n+1. Yet, the Effect still points to index n, not n+1, which breaks the behavior of the Effect.
How Will the Idea Help My Workflow?
When I am setting up one layer that I plan to duplicate (e.g., 100 times), it requires testing the crowd behavior, such as for motion graphics or particle simulations. With this change, my layer, where I am doing all the expressions, will stay put next to other top layers containing controls to those expressions, not drift away.
Applying the fix would also save me the time of going into every pulldown for every layer and changing it to self for every test I make, which amounts to a lot of time saved.
It would be much more convenient to have this feature integrated and fixed by default, rather than relying on a custom-written script, which I resorted to out of desperation.
A call for action: if you feel this feature might improve your workflow too, upvote the post, please!