A family of Microsoft word processing software products for creating web, email, and print documents.
The STYLEREF field in the endnote area may reference the heading text of the next section (rather than the current one). I guess that it is the problem you are referring to?
As far as I know, this is a bug, but I don't know if it is old or new.
If you unlink headers/footers (that is what Doug's macro does), you can enter the info that should go into them manually. The downside is that adding the info may be a time-consuming process, of course.