You can't merge the TOC as pdf utils operation, because it would run before the script. It is not aware of the landscape template you add in the script. So you need to merge the TOC in the script as well after you've appended the landscape template.
Here is the updated playground
https://playground.jsreport.net/w/anon/p7otW5KZ