Looks like this bug started with 7.46. It still exists in the 7.76 release.
I tried this code in 7.45 and it did not cause a error.
The bug seems to be based on how fast your storage is. Slower the storage the more likely you will hit the bug.
250GB 5400RPM drive it prints the write error when %x gets between 997 and about 750.
100MB Ramdisk is a bit more difficult to replicate the issue, sometimes it will not error at all.
alias write_bug {
var %x 1000
while (%x) {
write -l 1 test newline1
echo -ag %x
dec %x
}
}