The final "residual" block is being written unencrypted. This makes decryptcore(8) garble it. Which makes trying to decompress with gzip/zstd error out when reaching the end (it's still possible to decompress most of the file though).
IIUC, there can only be a residual block like this when using compression.
I changed this code to be more like _dump_append() and now I don't get any more decompression errors (tried both with local partition dumps and netdumps).