OOps, sorry, I meant to post this on the main forum, will try to fix that.
@Jeremy – if your TOC is part of the main threaded text, that is holding your contents of the document ( = both, TOC and contents is in the same story), an update of the TOC will:
1. Create a new TOC (and removing all contents of the whole story at the same time).
2. The TOC will be empty, because there is no contents anymore to update it.
So the solution is:
Create your TOC in a separate story.
And update then.
If your TOC is already in a separate story (not threaded to anything else), then we have a different case (and I have no clue what's going on).
When I initially created the TOC, I put it into a separate story, and the TOC was empty — but the main text (which is in another single story) remained. Then when I updated the TOC, the main story was replaced with the word "Conents" (same as the TOC).
So I have no clue what's going on either! It must be some sort of file corruption not repaired by the IDML round-trip. Your own bafflement suggested that file corruption was the problem rather than some silly mistake I was making.
However, great news: I made a new document, pasted the main story into it, and now everything seems to be working in this new document.
Many thanks again for your help, especially since I foolishly posted my question in the wrong forum.