+1 I was also surprised by this quirk.
I did not expect Select Same to select invisible objects, and I also did not expect Select Same to select locked objects. Without some way or option to limit the scope to only visible/unlocked objects, this feature is really hamstrung for my uses.
When the Select Same feature selects locked objects, you can easily end up in a situation that feels like a bug: Given I have 10 green circles that are visible, and 5 other green circles that are invisible and locked. Goal, to move the 10 green circles to a different part of the canvas. When I click one green circle, and Select Same, the 10 visibles + 5 invisible and locked circles are selected. And when I try to move my selection to the different part of the canvas, by dragging with the mouse or arrow keys, I cannot move them, because the locked ones are locked. Personally I would have expected only the visible ones to be selected, and then I could have moved them where I wanted.