Table of Contents including wrongly formatted titles

I’m using Win 10, LO 6. Editing a book of poetry. I formatted the titles as Heading 1 and the text as default. When I generate a TOC, it includes most of the titles correctly, but in two cases it includes every line of the poem, all on one page. I’ve checked those poems to make sure the text is in Default format, and it is.
I’ve formatted a previous book of poetry without this problem, using LO 5.
Any ideas as to making it work correctly?
(Later addition) I uninstalled LO6 and reinstalled LO 5 and still get the same result. What am I missing?

Toggle Formatting Marks (View Menu), and make sure you have hard paragraph returns after the Headings. Soft returns will keep the H1 Paragraph Style in the following lines, even though they may have been subsequently changed to look like Body Text, and they will show in the ToC.

Thanks. That’s a better answer than I have. I solved the problem by “worrying” it until it yielded. Here’s how. For each poem that had lines included incorrectly in the TOC, I noticed that the Navigator included the lines in the list of headings, and it also included blank lines in the list of headings. It seems that these were associated with the incorrect inclusion of the lines in the TOC, so, with some effort, I deleted the marks in the text to which the incorrect headings pointed. At time this meant deleting the poem and re-inserting it from the original documents. One by one, the poems were included correctly in the TOC with no errors. I would be prouder of my “solution” if I knew what I did.