Jonathan Kew - 2022-11-18

This is not a XeTeX issue, it's the expected result of how the e-TeX right-to-left support works. For a simplified example, try

\TeXXeTstate=1

\hsize 13cm

\noindent \beginR \hbox{This horizontal box should contain enough text so that
its width is the same a}

\noindent \beginR \kern 3cm \hbox{This horizontal box should contain}

\noindent \beginR \kern 3cm \hbox{This horizontal box should contain enough
text so that}

\noindent \beginR \kern 3cm \hbox{This horizontal box should contain enough
text so that its width is the same a}

\end

with plain pdf(e)tex.

This is essentially the same effect as you see in an example like

\TeXXeTstate=1

\hsize 5cm
\hyphenpenalty 10000

\noindent \beginR 
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\end

where, although the paragraph is right-to-left, the overfull lines are still flush with the left margin and project (and show their overfull markers) to the right, where a "truly right-to-left" system might be expected to reverse this.