Thanks for the great debugging so far.
Are you able to reproduce this issue using random input data?
If so, could you post the complete code including all seeds etc. which would reproduce this issue please, so that we can debug further?