I hit an issue where I could no longer boot any of my CM4 modules in device mode from my Mac.
This was particularly annoying as I had previously booted all of them to update firmware and write the OS.
Every so often one of the devices would boot past "bootcode.bin" but more often than not I would get:
Failed control transfer (-7,24)
Failed to write correct length, returned -7
I tried different populations of boards and boards in different slots (knowing they previously worked) - to no avail.
Then I realised I had "balena etcher" still running which I was using to write the OS. I closed the app and device booting worked consistently.
I now see that balena must have been probing the USB bus for new storage devices causing the boot process to work. But I though I would point this oiut in case it helps anyone.