This is a known issue. You can hold Cmd/Ctrl to select the top-level layers first instead of directly selecting all nested ones. There are no ways to prevent it but you can see some other workarounds in this thread: Prevent viewers from selecting content of an icon frame