If the point is to get the subset of a list that runs from the first element to the one before the first occurrence of a given value, then I'd do instead (in zsh, not bash):
list=(
first second '3rd with spaces' '4th with cd and
newline' $'5th\0with\0nuls\0' '' etc etc cd more elements
)
subset=( "${(@)list[1,list[(i)cd]-1]}" )
typeset -p1 subset
Which here gives:
typeset -a subset=(
first
second
'3rd with spaces'
$'4th with cd and\nnewline'
$'5th\C-@with\C-@nuls\C-@'
''
etc
etc
)
Which allows you to work with arbitrary lists of elements.
You can simplify it to subset=( $list[1,list[(i)cd]-1] ) if you don't have to account for empty elements (quotes combined with the @ parameter expansion flag are there to preserve those empty elements like in the Bourne shell's "$@"). \C-@ is a representation of the NUL aka \0 aka ^@ character, \n (same as \C-J) a representation of newline aka LF aka \12.
$list[(i)cd] (or just list[(i)cd] inside an arithmetic expression like here) expands to the index of the first element matching the cd pattern. If there's no match, it expands to 1 plus the size of the list, so $list[1,that-1] would give you the whole list.
To modify the list in-place, you could also perform this array slice assignment:
list[(r)cd,-1]=()
Where the (r) subscript flag is for reverse-subscripting to refer to the first element that matches the pattern.
Then:
$ typeset -p1 list
typeset -a list=(
first
second
'3rd with spaces'
$'4th with cd and\nnewline'
$'5th\C-@with\C-@nuls\C-@'
''
etc
etc
)