I do indeed use \marginpar, but only a couple of times, and some 40-50
pages before the error occurs (and there are three \clearpages in
between). As this is generated from XML, and I know what creates what, I
was able to check it very easily, and it turned out as Robin suggested,
a stray \marginpar occurring inside a minipage, because I had commented
out the <xsl:if> code that was intended to detect it.
Thank you both!
///Peter