How can I stop locked layers from moving with Alignment property? (when accidentally selected)

Have a frame with multiple objects in it. I’m aligning/centering modals overtop and even though layers underneath are locked within the frame, they still get selected and move because I’m selecting the parent frame to center the modal to.

This seems completely counter intuitive if the layers are locked, they shouldn’t move… I missing something?
(Yes I can carefully make sure child layers aren’t selected but it’s a pain.)