find
is receiving -not -path *test/.util/*
as a single argument, not as 3 separate arguments that it requires. You can use an array instead.
x=(-not -path "*test/.util/*")
y=(-not -path "*test/sh/*")
find test -type f -name "*.sh" "${x[@]}" "${y[@]}"
When quoted, ${x[@]}
expands into a series of separate words, one per array element, and each word remains properly quoted, so the patterns are passed literally, as intended, to find
.