Thanks to sending me your saves, I managed to find a workaround, hopefully. I just rewrote part of dialogue handling logic. I hope it doesn't break anything, but from my quick testing it seems it works as it should and doesn't throw errors.