One really easy way to get a timeout/out of memory error is to forget to call the_row(); in your while ( have_rows( <fieldname> ) ) loop. That means that the row counter doesn’t advance and you get into an infinite loop.
‘scuse me if that’s obvious – I just got asked to debug someone’s template and that was the problem.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users