In his commentary on Acts, Professor Richard Longenecker makes this comment about Acts 2:25:
"It should be remembered that only Luke among the synoptists omitted the cry of dereliction from the cross: 'My God, my God, why have you forsaken me?' (Matt 27:46; Mark 15:34); and only Luke has included the more filial, final word: 'Father, into your hands I commit my spirit' (Luke 23:46). Both the omission and the inclusion are in line with the quotation of Ps 16:8 here [in Acts 2:25]: 'I saw the Lord always [DIA PANTOS] before me. Because he is at my right hand, I will not be shaken'" (Longenecker 77-78).
It is possible that Jesus' cry of dereliction could be understood in the light of Ps. 22:1ff; John 8:29; 16:32. Based on the Johannine passages, it seems highly unlikely that the Father was ever spiritually separated from His beloved Son as some claim. For example, "In these words Christ, when hanging on the cross, complained, that he was deprived, for a time, of the loving presence and comforting influence of his heavenly Father" (Benson Commentary)
Moreover, one should not infer that Jesus was mistaken in his cry--the key to what Jesus meant is echoed in Ps. 22:1:
"My God, my God . . . why are you far from saving me?" (NWT)
According to this fateful OT writing, God Jehovah forsook the Son in that he allowed his enemies to kill the Messiah. God did not intervene when His Son was being put to death though it undoubtedly pained the Father greatly to see His Son executed as a common criminal (Isa. 63:9). Prophetically the Son said, "O my God, I keep calling by day, and you do not answer" (Ps. 22:2 NWT). Additionally he prayed:
"I am a worm, and not a man, A reproach to men and despicable to the people" (Ps. 22:6).
Psalm 22 indicates that the Son was "abandoned" in the sense that Jehovah did not deliver Christ from his [the Son's] adversaries; He lovingly allowed the Son to die so that Christ might taste death for every man and woman (Heb. 2:9). Yet while God allowed the Messiah to suffer, He was still with the Son by empowering and supporting him through an extremely ignominious and painful trial (John 16:32).
When commenting upon the "cry of dereliction," William Barclay posits three possible meanings:
(1) Jesus repeated the words of the Psalm as a "song of trust and confidence" (a view held by Dibelius and others). In support of this view, read Ps. 22:3-5, 20-31.
(2) The weight of the world's sins came upon Jesus (2 Cor. 5:21). I would be glad to elaborate upon 2 Cor. 5:21 later to show why I tend to disagree with this possibility.
(3) Jesus was showing his communion with humans. Just as we may sometimes feel that God has forsaken us, even when He clearly has not, so Jesus descended to the proverbial "depths of despair" and felt that God had abandoned him. Cf. Heb. 5:7, 8, however.
While all of these views are quite possible, I find the previous explanation to be most compelling. In light of Ps. 22 and the Gospel of John, the Father only forsook Jesus by allowing him to be put to death. That's my "humble opinion."