Not quite, but I am getting close. The new version is much closer to justCarmen’s webtrees code, so the cause is somewhere between her new code and the changes I had to make so it could work in kiwitrees.
It only effects fairly extreme cases such as your “Historic” GEDCOM file. I’ve yet to find any other example with the same problem. I am aware that justCarmen is also working on a slightly similar bug herself, one that relates only to very large trees with complex relationships. When I get the right time I will discuss it with her. We work very well together.