Good news is that it is possible to get debug logs out of an iPhone! I created a debuglog from iPhone where this issue happens and it seems that the answer from dovecot to such a message:
20:27:12 - EX32 UID FETCH 7840 (UID BODY.PEEK[1]...
cannot/is not read by the iPhone. The iPhone tells then in the log that:
20:27:47 - [02-EX] Connection appears to have been stuck for 35.3 s ....
multiple times - until: 20:28:41 - [02-EX] Connection appears to have been stuck for 89.3 s. Cancelling. 20:28:41 - [02] Connection EX failed while 4 command(s) EX33 EX35 EX32 EX34 were running and '<private>' was selected.
And then it opens a new connection, and the previously scheduled message is finally requested.
You can find the logfile here: https://drive.google.com/file/d/1UgUSIVvaGSiEzu5p_gjqyQcucd8XrJvQ/view?usp=s...
And a screenshot of the wireshark trace here: https://drive.google.com/file/d/14lpv36ekMv9LO2tLyzElIE0ApBN8E207/view?usp=s...