Before you go down that route, you could try enabling Heuristics before converting your html file to mobi. Heuristics attempts to detect the chapters automatically.
In conjunction with heuristics you also need to change the chapter detection xpath under Structure Detection, set the xpath to '//h:h2'
You should also read this thread:
https://www.mobileread.com/forums/sho...d.php?t=119731
I explained there in more detail how this works, don't really feel like typing it out again.
Generally speaking you can get the TOC generated directly within Calibre during conversion. However if Heuristics doesn't work or you can't figure out Xpath, Piper's suggestion of fixing it using Sigil is your best option.