Please see the attached video.
I've managed to fix this by altering the source code of method ParagraphLayoutBox.MeasureOverride and hope it doesn't cause other problems.