There is no contradiction or forgetfulness of Yeshua's part. Peter did ask where he was going previously, and Thomas implies the question, but at this particular time nobody asked him where he was going.
But now I am going to him who sent me. None of you asks me, ‘Where are you going? ’Rather, you are filled with grief because I have said these things.
νῦν δὲ ὑπάγω πρὸς τὸν πέμψαντά με, καὶ οὐδεὶς ἐξ ὑμῶν ἐρωτᾷ με Ποῦ ὑπάγεις
The word ἐρωτᾷ (asks) is in the present tense. You can see that here, as well as in the translation. Meyer's NT Commentary offers the interpretation that Yeshua paused between "me" and "none", though he says such an interpretation is unnecessary...
None of you asks me: whither dost Thou go away? but because I have spoken this to you, namely, that after my departure such sufferings shall befall you, grief has filled your heart, so that you have become quite dumb from sorrow, and blunted to the higher interest which lies in my going home to Him who sent me. According to De Wette and Lücke, there is said to be a want of exactness in the entire presentation, resting on the fact that John 16:6 does not stand before καὶ οὐδείς. The incorrectness of this assumption, in itself quite unnecessary, lies in this, that the first proposition of John 16:5 is thus completed: “But now at my departure I could not keep silence concerning it,” by which the 6th verse is anticipated. According to Kuinoel and Olshausen, a full point should be placed after πέμψ. με, and a pause is to be assumed, in which Jesus in vain awaited a question, so that He continued subsequently with an interrogation: “Nullusne vestrum me amplius interrogat, quo abiturus sim?” But the assumption of pauses (others, including De Wette, make the pause after John 16:5) is, when the correlation of the conjunctions is so definitely progressive, unwarranted.
The fact that already in John 13:36 the question had been put by Peter ποῦ ὑπάγεις (comp. the question of Thomas, John 14:5), does not stand in contradiction with the present passage; but Jesus censures simply the degree of distress, which they had now reached, in which none among them fixed his eye on the goal of the departing One, and could come to a question for more definite information respecting it.