When you fail to repair and erase the USB drive in Disk Utility, you can also try other ways to reformat it, including FSCK and Terminal. On Windows, you can use the CHKDSK command, unlock the USB drive, and reformat it.
You are unlikely to get the error notice "macOS can't repair this disk" in simple disk repair circumstances. Only when a disk problem or damage is too severe for Disk Utility First Aid to fix does the error message display. Examples of such problems include a dead hard drive and file system corruption. As Apple suggests, you can try to run First Aid to repair the USB drive again. Also, you can try FSCK in Single User Mode to repair the drive.
If the USB flash drive still can't be repaired, you should make sure the USB flash drive is mounted in Disk Utility, when the USB flash drive is not mounting on Mac, you can't format it. Try to manually select the USB flash drive and click the Mount button.
Unluckily, you can't reformat the USB flash drive on Mac even if it is mounted, try the methods below to get it solved:
- Change permission on Mac if you can only read the USB flash drive.
- Erase selected volumes instead of the whole drive.
- Erase the USB drive with Terminal commands diskutil list and diskutil eraseDisk APFS device node.
- Erase the USB flash drive in macOS Recovery Mode.
- Reboot the Mac into Safe Mode.
- Delete the partition.
RAW file format could be caused by improper ejection, you can also try the CHKDSK command on Windows and reformat the USB drive in Disk Management and via Diskpart.