This error raised its ugly head for me. I noticed this error disappeared when I selected another TOC.
So then I recreated a new TOC. After adding topics to the TOC one by one it failed after adding a topic -
Narrowed it down to two topics that failed - they both had a <h2 class="PageBreakBefore"> entry on the first line of the topic.
(I would have set them when creating a print traget) Set them to <h2> and no longer had a problem.
Why this causes a problem I have no idea! If anyone can explain why I'd appreciate it.

Someone's boring me. I think it's me.