Best practice: try to not have duplicate layer names in a map (but I know there are reasons you might want that, so...)
This issue was discussed here: https://community.esri.com/message/833996-re-applying-field-calculator-only-on-selected-features?com...
With duplicate layer names, if you have a selection on the second layer, and if you've right-clicked the field header to open the Calculate Field tool, the tool gets populated with the first layer. As a user, you could switch it over to the second layer, but why would you - you instantiated the tool from the second layer, right?
Anyway, we have a fix for that in Pro 2.4. So until then, not having duplicate layer names will help avoid issues. I hope this helps!