Gospel of Thomas
Thomas may well have travelled to India via Egypt, but that would have been in the mid 1st century, and there is no record of him writing a text whilst in Egypt, nor leaving it in a cave at Nag Hammadi.
The Gospel of Thomas found at Nag Hammadi is in Coptic and likely to have been written in the early 4th century. It is nearly identical to the earlier Greek Gospel of Thomas, which survives in three fragmentary copies. This earlier Greek text was probably written in Edessa by Syriac Christians in the early 2nd century who had brought the earlier oral traditions from Jerusalem. These earlier oral traditions may be as early as 30-50CE, the time of James, Thomas and other disciples, living in Jerusalem.