As you mention that your formatting failure is due to the inability of writing to the last block of the device, I can learn that you run into the "A writable disk is required (-69772)" or similar error on your Mac.
The "Unable to write to the last block of the device" error is not rare when erasing an external hard drive on Mac. If you face with this problem, you can try these solutions:
1. Reconnect the external drive to Mac
This error report could be caused by the communication issue. You can safely eject the external drive and then reinsert it into another port on your Mac. If the error still pops up, change a USB cable.
2. Securely erase the Toshiba external drive
Securely erasing an external hard drive can clean possible problematic blocks on it. But it will make the data on the drive irrecoverable. So, ensure you have a backup of the data on the drive. Or, if your Toshiba drive is APFS-encrypted, you can use a data recovery tool like iBoysoft Data Recovery for Mac to recover data on it before securely erasing it.
- Open Disk Utility.
- Select the drive and click Erase.
- Click Security Options on the pop-up dialog box.
- Move the slider to the second option and click OK.
- Enter a name, select a file system, and choose GUID Partition Map.
- Click Erase.
3. Repeat the formatting operations
If you still can't format the drive, repeat to format it several times.
4. Erase the external drive on another Mac
Perhaps, there's a bug in the communication between your Mac and the external drive. Format the external hard drive on another Mac.
5. Try to use the Terminal
- Open Terminal.
- Enter the command below and press Return.
- Write down the disk number of the external drive.
- Copy and paste the following command and press Return. Replace disk_name with the name of the external drive and replace disk_number with the disk number you've just written down.
diskutil eraseDisk file_system disk_name /dev/disk_number
- Quit Terminal.
Now, go to format your Toshiba drive and check if the error "Unable to write to the last block of the device" appears or not.