The issue is always the same. I need to reboot again into fastboot, while the script is waiting for a device, then it resumes and finishes the task. I tried again, and it's the same, replugging while in fastboot does not work, only reboot again into fastboot while staying connected.
Ok, solved...