"Download messages for offline use" only works partly

I put check marks in my IMAP account for “Download messages for offline use” and for “Include attachments and images”. However only a small part of all messages are downloaded. Sometimes, if the message is downloaded, the attachments are not.
How can I download all messages with attachments and images?

The problem may be related to the error message:
18:47:20 xxxxxxxxx[IMAP]  MailClient.Accounts.ConnectionException:
18:47:20 ()
18:47:20    at MailClient.Protocols.Imap.Synchronizer.ImapCommand.ThrowIfConnectionBroken(BasicResponse response)
18:47:20    at MailClient.Protocols.Imap.Synchronizer.PrefetchCommand.ExecuteInternal(WorkerStatus status)
18:47:20    at MailClient.Protocols.Imap.Synchronizer.ImapCommand.Execute(WorkerStatus status)
18:47:20    at MailClient.Commands.Command.Process(WorkerStatus status)

After this error, the downloading stops and doesn’t restart

FastMail is my email provider