Reading the manual or help on how to create a TOC would be a first step, so you know how the program works....
But to cut to the chase, you should probably go into your book file and delete your existing TOC because whatever change you made has corrupted it. It's easier to start with a fresh file than try to figure out what brokie.
Next, Add a new TOC to the book file, and set it up to record the types of tags that you want to display. Save and update the book.
Is your second "finished" .jpg from a file that you can open, or can you open a properly formatted TOC file? If so, open it. If not, look in your Frame templates directory for a TOC that's similar to what you want to achieve. Open that.
In your real TOC, execute File > Import > Formats and specify the "model" TOC as your source. The only format you may want to not import are Variables. Get everything else.
After you import the model formats, save your real TOC. In the book file, Update. Your TOC should generate with the new formats in place. From there, it should be a relatively easy job to modify the formats, a step at a time, to get to the finished product.
Art