See https://github.com/sile-typesetter/sile/pull/2360 = Same issue if `\tocentry` is invoked from a SIL document.