you might wanna take a look over here and ask for access to the beta. its for a new loop block that contains batch and parallel features which might help here.
otherwise have you tried using the 'Retry per iteration' to retry on an error? you could also try adding a global error handler and setting Finally on the loop to continue (instead of exiting the workflow immediately it'll continue on down any error path you have, like a global error handler)
i'll update this if i think of anything else. for reference, you can get 502 by sending too many requests (or with too much traffic)... it basically overwhelms the server and it gives up