The only uncertainly is the difficulty, or not, to find the text strings that defines each bookmark title and page target, as you haven't provided a sample file.
Thinking out of the box, because the merger tool is able to create bookmarks with the name of each merged file, the document can be searched for these text patters, split it at these page intervals (between two search matches) to a new file, named with the text found, and then merge this files into a new PDF.