detail is what actually failed. A gateway timeout on member_fetch_failed (detail matches /time|abort/i) is intermittent - run it again; anything else repeatable points at the GuildMembers intent.
Write batches that came back with nothing - those members may be partly written; run it again.
Members whose roles are wrong right now.
Still wrong after this call - non-zero means run it again.
Written this call (0 on a dry run).