I believe it is thought possible that Matthew had access to writings of an apostle, but that doesn't mean he wrote an earlier version doesn't it?
Can I give you an example:
Mt 5:31 says, "It was also said, 'Whoever divorces his wife, let him give her a certificate of divorce.' 32But I say to you that everyone who divorces his wife, except on the ground of sexual immorality, makes her commit adultery, and whoever marries a divorced woman commits adultery"
Compare this with Mt 19:9
"9And I say to you: whoever divorces his wife, except for sexual immorality, and marries another, commits adultery."
This saying about divorce is in both chapters 5 and 19.
In 19:9 the context is a dispute with the religious leaders about divorce, and the saying fits naturally into its context.
5:31-32 however seems to have been tagged onto the previous saying in 5:27-28 which is specifically about the commandment against adultery, and conforms to the formula "you have heard that it was said...but I say to you". It appears likely that Jesus originally talked specifically about divorce during the dispute with the Pharisees, recorded in chapter 19. Mark also records the dispute.
Like lots of other examples there seems to have been editing. Whether this was done as part of the process of writing the original text I'm not sure.