I didn't look deep. However....
In toc template you iterate over your computed data property Page.
You compute it only when $pdf property is filled and this happens only during the merge operation.
This means the main template doesn't print anything in the toc child template.
So you don't see anything.
The main template run should print the toc structure with a links.
The merge operation should just insert the page numbers to the correct position.