I don't think you're drawing the correct conclusion from that comment. The standard for Arduino functions named write is that they should return the number of bytes written so that's the reason why 0 is returned when the write fails but you shouldn't consider that 0 an error code, it just means 0 bytes were written successfully. getWriteError() will give you the actual error code to explain the cause of the write failure. I'm not very familiar with this library, haven't made much of an effort to read through the source, and the documentation is not very good but I did find a list of error codes (though I'm only guessing they apply to getWriteError()):
https://github.com/greiman/SdFat-beta/blob/master/SdFat/src/SdCard/SdInfo.h#L37-L86
// SD card errors
// See the SD Specification for command info.
typedef enum {
SD_CARD_ERROR_NONE = 0,
// Basic commands and switch command.
SD_CARD_ERROR_CMD0 = 0X20,
SD_CARD_ERROR_CMD2,
SD_CARD_ERROR_CMD3,
SD_CARD_ERROR_CMD6,
SD_CARD_ERROR_CMD7,
SD_CARD_ERROR_CMD8,
SD_CARD_ERROR_CMD9,
SD_CARD_ERROR_CMD10,
SD_CARD_ERROR_CMD12,
SD_CARD_ERROR_CMD13,
// Read, write, erase, and extension commands.
SD_CARD_ERROR_CMD17 = 0X30,
SD_CARD_ERROR_CMD18,
SD_CARD_ERROR_CMD24,
SD_CARD_ERROR_CMD25,
SD_CARD_ERROR_CMD32,
SD_CARD_ERROR_CMD33,
SD_CARD_ERROR_CMD38,
SD_CARD_ERROR_CMD58,
SD_CARD_ERROR_CMD59,
// Application specific commands.
SD_CARD_ERROR_ACMD6 = 0X40,
SD_CARD_ERROR_ACMD13,
SD_CARD_ERROR_ACMD23,
SD_CARD_ERROR_ACMD41,
// Read/write errors
SD_CARD_ERROR_READ = 0X50,
SD_CARD_ERROR_READ_FIFO,
SD_CARD_ERROR_READ_REG,
SD_CARD_ERROR_READ_START,
SD_CARD_ERROR_READ_TIMEOUT,
SD_CARD_ERROR_STOP_TRAN,
SD_CARD_ERROR_WRITE,
SD_CARD_ERROR_WRITE_FIFO,
SD_CARD_ERROR_WRITE_START,
SD_CARD_ERROR_WRITE_TIMEOUT,
// Misc errors.
SD_CARD_ERROR_DMA = 0X60,
SD_CARD_ERROR_ERASE,
SD_CARD_ERROR_ERASE_SINGLE_BLOCK,
SD_CARD_ERROR_ERASE_TIMEOUT,
SD_CARD_ERROR_INIT_NOT_CALLED,
SD_CARD_ERROR_FUNCTION_NOT_SUPPORTED
} sd_error_code_t;
Note that SD_CARD_ERROR_NONE is 0.