(KJV) Matthew 14:26
26 And when the disciples saw him walking on the sea, they were troubled, saying, It is a spirit; and they cried out for fear. 27 But straightway Jesus spake unto them, saying, Be of good cheer; it is I; be not afraid. 28 And Peter answered him and said, Lord, if it be thou, bid me come unto thee on the water. 29 And he said, Come. And when Peter was come down out of the ship, he walked on the water, to go to Jesus. 30 But when he saw the wind boisterous, he was afraid; and beginning to sink, he cried, saying, Lord, save me. 31 And immediately Jesus stretched forth his hand, and caught him, and said unto him, O thou of little faith, wherefore didst thou doubt?
All the Evangelists except Luke record Jesus walking on the water, but it is only Matthew who goes further to narrate the incident of Peter attempting to walk on water.
(KJV) Mark 6:45
45 And straightway he constrained his disciples to get into the ship, and to go to the other side before unto Bethsaida, while he sent away the people. 46 And when he had sent them away, he departed into a mountain to pray. 47 And when even was come, the ship was in the midst of the sea, and he alone on the land. 48 And he saw them toiling in rowing; for the wind was contrary unto them: and about the fourth watch of the night he cometh unto them, walking upon the sea, and would have passed by them. 49 But when they saw him walking upon the sea, they supposed it had been a spirit
(KJV) JOHN 6:19
19 So when they had rowed about five and twenty or thirty furlongs, they see Jesus walking on the sea, and drawing nigh unto the ship: and they were afraid. 20 But he saith unto them, It is I; be not afraid. 21 Then they willingly received him into the ship: and immediately the ship was at the land whither they went.
Did Matthew get his information from a different source?