I've run into a scenario where if the TOC title is too close to the TOC numbering, it pulls the numbering inwards.
Here you can see several examples where I started adding/removing one character at a time to see when it would incorrectly pull the numbering inward vs correctly wrapping to the next line.
Here are two blocks from topic.fo. The first is one is not pulling in the TOC numbering and the second is pulling the numbering in.
<fo:block
start-indent="0in + (2 * 30pt) + 14pt">
<fo:block
end-indent="22pt"
font-size="10pt"
font-style="italic"
font-weight="normal"
last-line-end-indent="-22pt"
text-align="justify"
text-align-last="justify"
text-indent="-14pt"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">
<fo:basic-link
internal-destination="_OPENTOPIC_TOC_PROCESSING_d73e797"
line-height="150%"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">
<fo:inline
end-indent="14pt"
keep-together.within-line="auto"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">Notes Associated with an Improperly Filled Card or a Negative Profile (Biopattern)</fo:inline>
<fo:leader
leader-pattern="dots"/>
<fo:inline
keep-together.within-line="always"
padding-left.length="12pt"
start-indent="-14pt"
text-align="right"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">2-<fo:page-number-citation
ref-id="_OPENTOPIC_TOC_PROCESSING_d73e797"/>
</fo:inline>
</fo:basic-link>
</fo:block>
</fo:block>
<fo:block
start-indent="0in + (2 * 30pt) + 14pt">
<fo:block
end-indent="22pt"
font-size="10pt"
font-style="italic"
font-weight="normal"
last-line-end-indent="-22pt"
text-align="justify"
text-align-last="justify"
text-indent="-14pt"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">
<fo:basic-link
internal-destination="_OPENTOPIC_TOC_PROCESSING_d73e800"
line-height="150%"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">
<fo:inline
end-indent="14pt"
keep-together.within-line="auto"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">Notes Associated with an Improperly Filled Card or with a Negative Profile (Biopat</fo:inline>
<fo:leader
leader-pattern="dots"/>
<fo:inline
keep-together.within-line="always"
padding-left.length="12pt"
start-indent="-14pt"
text-align="right"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">2-<fo:page-number-citation
ref-id="_OPENTOPIC_TOC_PROCESSING_d73e800"/>
</fo:inline>
</fo:basic-link>
</fo:block>
I've tried adjusting the different end-indents to see if I could force it to wrap without any luck. I am using DITA-OT 1.5.4 and FOP 1.0.
Look like a bug in FOP, see FAQ.
This happens for fo:page-number-citation elements if the citation occurs before FOP formatted the requested page, usually in TOC or index pages. It is caused by the problem that FOP has to guess how much space the yet unknown page number will occupy, and usually the guesses are somewhat off.
The most recent FOP releases should have this problem fixed. Check whether you can upgrade.