You are 100% correct about the payouts looking for the 1st or 2nd transaction to send back. This is why we ask you not play from JD or exchanges.
I don't think you understand the point I am trying to make.
Check the 2 examples I linked to. Check in your database to see which address they are set to pay out to. It isn't the 1st or 2nd "input address".
Edit: I posted a
github issue for the bug too, though the repository there hasn't been touched for 18 months, so I guess it has been abandoned.