ssh
doesn't preserve quoting, so you need to escape commands locally to be unescaped by the remote shell.
for el in "${PRIMARY_PARTITION[@]}"
do
printf -v cmd '%q ' test -e "$dir3/t1_weekly_1680_${el}_200003_5.data"
ssh "david@$FILERS_LOCATION_1" "$cmd" \
|| ssh "david@$FILERS_LOCATION_2" "$cmd" \
|| { echo "File number $el missing on both the filers for primary partition." >&2;
exit 1; }
done