5 And he threw the pieces of silver into the temple and departed; and he went away and hanged himself.
Acts 1:18 Updated American Standard Version (UASV)
18 (Now this man acquired a field with the price of his wickedness, and falling headlong [Or, “and becoming swollen up.”], he burst open in the middle and all his intestines gushed out.
The specific word in Acts 1:18 that caused the difficulty regarding the death of Judas is prenes. For a long period of time, it was understood to mean only “falling headlong.” Twentieth-century investigations of ancient papyri, however, have revealed that this word has another meaning in Koiné Greek. It also means “swelling up.”―Erickson, Millard J. (1998). Christian Theology (p. 265). Baker Publishing Group.
Answer: Neither Matthew nor Luke made a mistake. What you have is Matthew giving the reader the manner in which Judas committed suicide. On the other hand, Luke is giving the reader of Acts, the result of that suicide. Therefore, instead of a mistake, we have two texts that complement each other, really giving the reader the full picture.
If the rendering “falling headlong” is correct, it could be that Judas came to a tree alongside a cliff that had rocks below. He tied the rope to a branch and the other end around his neck and jumped over the edge of the cliff in an attempt at hanging himself. One of two things could have happened: (1) the limb broke plunging him to the rocks below, or (2) the rope broke with the same result, and he burst open onto the rocks below.
However, if our current understanding of the word is correct, “becoming swollen up,” Erickson offers us a reasonable answer,
Having hanged himself, Judas was not discovered for some time. In such a situation the visceral organs begin to degenerate first, causing a swelling of the abdomen characteristic of cadavers that have not been properly embalmed. And so, “swelling up [Judas] burst open in the middle and his bowels gushed out.” While there is no way of knowing whether this is what actually took place, it seems to be a workable and adequate resolution of the difficulty.
 G. Abbott-Smith, A Manual Greek Lexicon of the New Testament (Edinburgh: T. &T. Clark, 1937), p. 377.
 Erickson, Millard J. (1998). Christian Theology (p. 263). Baker Publishing Group.