At this point in Matthew's narrative (27:39-50) he tells us of the attitudes, ideas and words of those involved with or observing Jesus' death to compare and contrast them to Jesus' own attitudes, ideas and words regarding his death. Ostensibly there is a language barrier but the incident was either concocted or included because the misunderstanding of his prayer allows Matthew to reveal how they didn't "get" what was going on. They all imagined that the Jewish and Roman establishment were in charge and that Jesus wanted to be rescued from death BUT in reality God was in charge Jesus wanted to be rescued by God through death. This passage is tightly coupled with his prayer in Gethsemane and his arrest in the previous chapter.
He was taunted and challenged to escape from his predicament in a challenge with a strong parallel with that of the devil:
Mat 27:39 Those who passed by kept insulting him, shaking their
heads, Mat 27:40 and saying, "You who were going to destroy the
sanctuary and rebuild it in three days—save yourself! If you are the
Son of God, come down from the cross!"
Mat 4:2 After fasting for 40 days and 40 nights, he finally became
hungry. Mat 4:3 Then the tempter came. "Since you are the Son of
God," he said, "tell these stones to become loaves of bread." Mat
4:4 But he answered, "It is written, 'One must not live on bread
alone, but on every word coming out of the mouth of God.'"
In both situations Jesus does not save himself, not because he can't but because he mustn't. His obedience was not only "to the cross" but "as far as death on the cross" (Phil 2):
Mat 26:52 Jesus told him, "Put your sword back in its place! Everyone
who uses a sword will be killed by a sword. Mat 26:53 Don't you
think that I could call on my Father, and he would send me more than
twelve legions of angels now? Mat 26:54 How, then, would the
Scriptures be fulfilled that say this must happen?"
His failure to be rescued by God (or Elijah) is derided as proof positive that he's not the son of God:
Mat 27:41 In the same way the high priests, along with the scribes
and elders, were also making fun of him. They kept saying, Mat 27:42
"He saved others but can't save himself! He is the king of Israel. Let
him come down from the cross now, and we will believe in him. Mat
27:43 He trusts in God. Let God rescue him, if he wants to do so now.
After all, he said 'I am the Son of God.'" Mat 27:44 In a similar
way, the bandits who were being crucified with him kept insulting him.
In his "darkest hour" he utters a prayer that is mistakenly interpreted as a call to Elijah to come and save him:
Mat 27:45 From noon on, darkness came over the whole land until three
in the afternoon. Mat 27:46 About three o'clock, Jesus cried out
with a loud voice, "Eli, eli, lema sabachthani?", which means, "My
God, my God, why have you forsaken me?" Mat 27:47 When some of the
people standing there heard this, they said, "He's calling for
Elijah."
But in reality he was praying to God asking him, why, despite his fervent prayers to die quickly he is still alive and suffering. My translation: "My God, my God, why have you left me here in the lurch?":
God's Word translation: Heb 5:7 During his life on earth, Jesus
prayed to God, who could save him from death. He prayed and pleaded
with loud crying and tears, and he was heard because of his devotion
to God.
Some responded to his "plea" with pity. Again, this shows that they did not understand his mission:
Mat 27:48 So one of the men ran off at once, took a sponge, and
soaked it in some sour wine. Then he put it on a stick and offered
Jesus a drink of wine in order to dull his pain. He tasted it but did
not drink it.
The fact that he tasted but did not drink becomes a simile of the fact that he would likewise "taste death" but not drink to the dregs the contents of the "cup" of the "pangs of death":
Heb_2:9 But we see Jesus, who was made a little lower than the angels
for the suffering of death, crowned with glory and honour; that he
by the grace of God should taste death for every man.
Others either suggested that it was still an open question whether or not he would be saved OR mocked because they believed his death to be inevitable:
Mat 27:49 But the others kept saying, "Wait! Let's see if Elijah will
come and save him."
After his prayer and the symbolic "taste", Jesus' prayers were answered and he supernaturally died:
Mat 27:50 Then Jesus cried out with a loud voice again and died.
His death was so inexplicable to the soldiers that it was doubly ensured by piercing his side with a spear:
Mar 15:44 Pilate was surprised to hear that he should have already
died. And summoning the centurion, he asked him whether he was already
dead. Mar 15:45 And when he learned from the centurion that he was
dead, he granted the corpse to Joseph.
Joh 19:31 Since it was the day of Preparation, and so that the bodies
would not remain on the cross on the Sabbath (for that Sabbath was a
high day), the Jews asked Pilate that their legs might be broken and
that they might be taken away. Joh 19:32 So the soldiers came and
broke the legs of the first, and of the other who had been crucified
with him. Joh 19:33 But when they came to Jesus and saw that he was
already dead, they did not break his legs. Joh 19:34 But one of the
soldiers pierced his side with a spear, and at once there came out
blood and water. Joh 19:35 He who saw it has borne witness—his
testimony is true, and he knows that he is telling the truth—that you
also may believe. Joh 19:36 For these things took place that the
Scripture might be fulfilled: "Not one of his bones will be broken."
So while the reason he was not understood when he uttered his prayer may have been a language issue, an acoustics issue or even a miraculous obstruction, the literary/religious purpose was to show that he was not a "victim" in the sense of being helpless to prevent his misuse but rather committed to obey God to the end and to escape his torment by a supernatural death, and thus fulfill Ps 22:
Psa 22:19 But thou, O Lord, remove not my help afar off: be ready for
mine aid. Psa 22:20 Deliver my soul from the sword; my only-begotten
one from the power of the dog. Psa 22:21 Save me from the lion's
mouth; and regard my lowliness from the horns of the unicorns. Psa
22:22 I will declare thy name to my brethren: in the midst of the
church will I sing praise to thee. Psa 22:23 Ye that fear the Lord,
praise him; all ye seed of Jacob, glorify him: let all the seed of
Israel fear him. Psa 22:24 For he has not despised nor been angry at
the supplication of the poor; nor turned away his face from me; but
Psa 22:19 But thou, O Lord, remove not my help afar off: be ready for mine aid.
Psa 22:20 Deliver my soul from the sword; my only-begotten one from the power of the dog.
Psa 22:21 Save me from the lion's mouth; and regard my lowliness from the horns of the unicorns.
Psa 22:22 I will declare thy name to my brethren: in the midst of the church will I sing praise to thee.
Psa 22:23 Ye that fear the Lord, praise him; all ye seed of Jacob, glorify him: let all the seed of Israel fear him.
Psa 22:24 For he has not despised nor been angry at the supplication of the poor; nor turned away his face from me; but when I cried to him, he heard me.
Note that the Psalm specifically rejects the idea that God "turned away" from Jesus (which is the way most understand "why have you forsaken me") but "heard" (answered) his earnest Gethsemane pleas.