Yes he was gonna sin, but knowing something doesn't make him do it. Ah you mean like Judas.
Those whom You gave Me I have kept; and none of them is [
g]lost except the son of [
h]perdition, that the Scripture might be fulfilled.
In this case I see Jesus picks Judas, although He knows who he is and although He knows that it will only add to his sin (it would have been better for him if he hadn't been born), but He doesn't care. He uses him for His purpose, as a vessel of wrath. It's not that Jesus had no clue, accidentally picked him and hey look in the O.T., they already prophecied this. Still it was his own choice.