It’s the precise positioning of the <div data-theme-toc="true"> </div>. In this case it was the first thing in the post and text started on the next line. We wouldn’t have even noticed if that first line didn’t contain markdown. Not sure if that makes sense.
If you put a blank line after that code, everything works. Hence Data-theme-toc="true" should be placed at the top of a post in it's own paragraph.