The discrepancy can be explained by their distinct target audiences.
Luke had a scientific mindset, was a gentile, commissioned by Theophilus, a gentile, targeting a gentile audience.
Luke 1:1 Many have undertaken to compose an account of the things that have been fulfilled among us,
Luke might even have read or investigated Matthew's account.
2 just as they were handed down to us by the initial eyewitnesses and servants of the word. 3Therefore, having carefully investigated everything from the beginning, it seemed good also to me to write an orderly account for you, most excellent Theophilus, 4so that you may know the certainty of the things you have been taught.
Apparently, Luke had seen disorderly accounts of the gospel. Luke is very clear in his description.
Luke 7:3 The centurion heard of Jesus and sent some elders of the Jews to him, asking him to come and heal his servant.
By providing this detail which Matthew does not, Luke demonstrated to Theophilus that some Roman soldiers had established good relationship with some Jewish authority. This was important to the gentile audience.
There is an additional detail in verse
6 So Jesus went with them. He was not far from the house when the centurion sent friends to say to him: “Lord, don’t trouble yourself, for I do not deserve to have you come under my roof. 7That is why I did not even consider myself worthy to come to you. But say the word, and my servant will be healed.
Luke was telling the gentiles that they had to respect the Jewish customs in order to have a good working relationship with the Jews.
On the other hand, Matthew was writing to the Jews. Did Matthew lie about the direct contact with the centurion? No. The Jews understood that a representative speaking for an authority was the same as the authority speaking directly such as the prophets speaking for the Lord. Also we had Mordecai representing King Xerxes
in Esther 8
7 King Xerxes replied to Queen Esther and to Mordecai the Jew, “Because Haman attacked the Jews, I have given his estate to Esther, and they have impaled him on the pole he set up. 8 Now write another decree in the king’s name in behalf of the Jews as seems best to you, and seal it with the king’s signet ring—for no document written in the king’s name and sealed with his ring can be revoked.”
For Matthew, the important point to the Jews was that the gentile centurion had humbled himself as shown in
Matthew 8:8 The centurion replied, "Lord, I do not deserve to have you come under my roof. But just say the word, and my servant will be healed.
Did the Roman soldier actually meet Christ as alluded in Matthew 8:5-6? No.
Did Matthew misrepresent the centurion's humility? No.
Did Matthew provide misleading facts in the passage? Not if you were a Jew.
For me, there is no real contradiction between the two accounts as long as we read each according to its own cultural readership. That, in fact, is a key of hermeneutics.