OK. I've now replaced the ToC again, but this time used the Generate ToC from Files option. It still gives the same error. So, I've used the ScrambleEbook PI on the book, uploaded it to Google Drive and am sharing the link here (hopefully, Google Drive won't do anything bad to the file):
https://drive.google.com/file/d/1G6R...ew?usp=sharing
According to the Preview function of that PI, the scrambled version seems like it's good. But, we'll see.
EDIT: I downloaded that scrambled version from Google Drive to my system and added it to Calibre and then my Forma. Tried to update the ToC as above and got the same error. So, it looks like that scrambled version of the book should be a good debugging proxy for the actual book.