2 Cor. 5:21 says, "He made Him who knew no sin to be sin on our behalf, that we might become the righteousness of God in Him." It is possible that at some moment on the cross, when Jesus became sin on our behalf, that God the Father, in a sense, turned His back upon the Son. It says in Hab. 1:13 that God is too pure to look upon evil. Therefore, it is possible that when Jesus bore our sins in His body on the cross (1 Pet. 2:24), that the Father, spiritually, turned away. At that time, the Son may have cried out.
One thing is for sure. We have no capacity to appreciate the utterly horrific experience of having the sins of the world put upon the Lord Jesus as He hung, in excruciating pain, from that cross. The physical pain was immense. The spiritual one must have been even greater.
That shows us clearly how much God loves us.