In
Ecclesiastes 12:7 it says the spirit goes to God right when you die.Also in Acts 7:54-59.Stephen said "jesus receive my spirit" as he was being stoned to death.Also in Hebrews 9:27.It says when you die the judgement.And in 2 Corinthians 5:10 it says we all must appear before jesus for judgment.Also in 2 Corinthians 5:6-9.It says we want to be absent from the body and present with God.And in 2 Corinthians 5:9 some people are already absent from the body and with the lord.
Yes, Ecclesiastes 12:7 does say the spirit "it" goes to God.
"it" goes to God in the same way a foreclosed house goes back to the owner.
The house does Not move or go anywhere but any future for the house now lies in the hands of the owner.
So, one's spirit ("it") returns to God, the Owner, in the sense that any future life (resurrection) is in God's safe hands.
James knew his life's spirit ("it") would be received favorably thus James would have a resurrection.
As for Hebrews 9:27; 2 Cor. 5:10 judgement for the dead happens after death after they are resurrected.
They can have either a favorable or an adverse judgement depending on what they do 'after' they are resurrected.
At Chapter 5 the ' we ' mentioned starting at verse one is for those of Revelation 20:6; 5:9-10 who have that first or earlier resurrection to heaven to reign with Christ for a thousand years over Earth, over Christ's earthly subjects.
The ' we ' mentioned are also Jesus' spiritual ' brothers ' which chapter 15 of 1st Corinthians is also about.
The later resurrection of Acts of the Apostles 24:15 is for those who will inherit (Not heaven) but inherit the earth.
So, in Scripture there are two (2) resurrection hopes:
One is a heavenly hope for some like those of Luke 22:28-30 ( a heavenly resurrection )
One is an earthly hope for those like those of John 3:13 ( an earthly resurrection )
In other words, some gain everlasting life in heaven, and the majority can gain everlasting life on earth.