If a problem is improved by sleeping, it's probably a race condition.
If it's a race condition, then sleeping is never a correct solution to the problem... you're just making it less likely to happen, not fixing it...
I've seen this kind of bug and the root cause is almost always that something is writing to a nonblocking pipe/service/whatever and not retrying when it fails because the buffer is full.
Second most likely cause is a hidden message size limit somewhere that isn't respected.