I think I figured out where the problem is. It has nothing to do with the number of sub pages, the problem happens when one of the sub pages also has the short code to show its own sub pages.
So if I put the short code on one page it shows a summary of all of its sub pages perfectly the way it’s supposed to. But if I put the short code on one of the sub pages to show a summary of its own sub pages, it causes the endless loop on the parent page.
How can I get this to work more than one level deep? Or is there a better plugin for this?