Jesus became sin at the cross, that was when he bore God's wrath and judgment for sin, which includes being forsaken.
After he endures all that at the cross, he was still alive, which indicated to us that, the sacrifice was greater than the judgment.
Thus when he said Father after that, he is telling us that he is restored to perfect fellowship with God the Father once again. The judgment for Adam's sin has been dealt with (Romans 5:12-19)
Jesus took on the punishment for sin,
2cor 5:21
For He made Him who knew no sin to be sin for us, that we might become the righteousness of God in Him.
Jesus never sinned But God placed on HIm NOT IN HIM, Jesus did not sin nor did HE know Sin HE suffered for others, not HIMSLF.
Jesus did not change to sin , or become a sinner,
His death was for you and me. Jesus was quoting PS 22 because those there were asking for a sign yelling at HIM to come down and they would believe. God did not forsake Jesus. In the Psalms when one would read the first part which would cause the assembly to respond with the remaining Psalm.
When Jesus said "
My God, my God, why hast thou forsaken me?
the response would be:
why art thou so far from helping me, and from the words of my roaring?
look at the remeaning verses from PS 22 and read the gospel crucifixion account.
O My God,
I cry in the daytime, but You do not hear;
And in the night season, and am not silent.
3 But You
are holy,
Enthroned in the praises of Israel.
4 Our fathers trusted in You;
They trusted, and You delivered them.
5 They cried to You, and were delivered;
They trusted in You, and were not ashamed.
6 But I
am a worm, and no man;
A reproach of men, and despised by the people.
7
All those who see Me ridicule Me;
They shoot out the lip, they shake the head, saying,
8 “He trusted in the LORD, let Him rescue Him;
Let Him deliver Him, since He delights in Him!”
9 But You
are He who took Me out of the womb;
You made Me trust
while on My mother’s breasts.
10 I was cast upon You from birth.
From My mother’s womb
You
have been My God.
11 Be not far from Me,
For trouble
is near;
For
there is none to help.
12 Many bulls have surrounded Me;
Strong
bulls of Bashan have encircled Me.
13 They gape at Me
with their mouths,
Like a raging and roaring lion.
14
I am poured out like water,
And all My bones are out of joint;
My heart is like wax;
It has melted within Me.
15
My strength is dried up like a potsherd,
And My tongue clings to My jaws;
You have brought Me to the dust of death.
16
For dogs have surrounded Me;
The congregation of the wicked has enclosed Me.
They pierced My hands and My feet;
17 I can count all My bones.
They look and stare at Me.
18
They divide My garments among them,
And for My clothing they cast lots.
19
But You, O LORD, do not be far from Me;
O
My Strength, hasten to help Me!
20 Deliver Me from the sword,
My precious
life from the power of the dog.
21 Save Me from the lion’s mouth
And from the horns of the wild oxen!
You have answered Me.
22 I will declare Your name to My brethren;
In the midst of the assembly I will praise You.
23 You who fear the LORD, praise Him!
All you descendants of Jacob, glorify Him,
And fear Him, all you offspring of Israel!
24 For He has not despised nor abhorred the affliction of the afflicted;
Nor has He hidden His face from Him;
But when He cried to Him, He heard.
25 My praise
shall be of You in the great assembly;
I will pay My vows before those who fear Him.
26 The poor shall eat and be satisfied;
Those who seek Him will praise the LORD.
Let your heart live forever!
27 All the ends of the world
Shall remember and turn to the LORD,
And all the families of the nations
Shall worship before You.
28 For the kingdom
is the LORD’s,
And He rules over the nations.
29 All the prosperous of the earth
Shall eat and worship;
All those who go down to the dust
Shall bow before Him,
Even he who cannot keep himself alive.
30 A posterity shall serve Him.
It will be recounted of the Lord to the
next generation,
31 They will come and declare His righteousness to a people who will be born,
That He has done
this.
_________________________
God did not forsake Jesus. And Jesus said
And when Jesus had cried with a loud voice, he said, Father, into thy hands I commend my spirit: and having said thus, he gave up the ghost.
Psalms 22 says
19
But You, O LORD, do not be far from Me;
O
My Strength, hasten to help Me!
21 You have answered Me.
24 For He has not despised nor abhorred the affliction of the afflicted;
Nor has He hidden His face from Him;
But when He cried to Him, He heard.