I tried all kinds of things, including closing the redirect with
exec 6>&- but nothing worked.
Finally I rewrote it like this and this is more reliable for me:
num_procs=2; while [[ -n $(find . -name '*.cloudf') ]]; do find . -name "*.cloudf" -print0 | xargs -0 -n 1 -P $num_procs python $(ls -d "$HOME/.odrive/bin/"*/ | tail -1)odrive.py sync; done
No redirection hacks needed!