My doctrine? I am not sure what you mean by that. Scripture says:
God made Him who knew no sin to be sin on our behalf,
so that in Him we might become the righteousness of God.
I agree with this from gotquestions:
On the cross, our sin was imputed to Christ. That is how Christ paid our sin debt to God. He had no sin in Himself, but our sin was attributed to Him so, as He suffered, He took the just penalty that our sin deserves. At the same time, through faith, Christ’s righteousness is imputed to us. Now we can stand before God sinless, just as Jesus is sinless. We are not righteous in ourselves; rather, Christ’s righteousness is applied to us (because Jesus never ceased to be holy, blameless, and pure, for He is the same yesterday, today and forever).
So, “God made him . . . to be sin for us” means that Jesus, although sinless, was treated as if He were not. Although He remained holy, He was regarded as guilty of all the sin in the world. Through imputation of our sin to Him, He became our substitute and the recipient of God’s judgment against sin. Having saved those who believe, He is now “our righteousness, holiness and redemption.”
Jesus was not forsaken in quoting Psalm 22. In the final analysis, those who refuse
to accept His shed righteous blood as a covering for their sin will be forsaken.