We are judged BEFORE we get to heaven.
Revelation 22:12
Berean Literal Bible
"Behold, I am coming quickly, and
My reward is with Me, to give to each as is his work.
The first resurrection (of the saved) happens when He returns ... that is when all the saved are taken to heaven to be with Him. The 2nd resurrection (of the lost) happens later.
1 Thessalonians 4
The Return of the Lord
13Brothers, we do not want you to be uninformed about those who sleep in death,
cso that you will not grieve like the rest, who are without hope.
14For since we believe that Jesus died and rose again, we also believe that God will bring with Jesus those who have fallen asleep in Him.
15By the word of the Lord, we declare to you that we who are alive and remain until the coming of the Lord
will by no means precede those who have fallen asleep.
16For the Lord Himself will descend from heaven with a loud command, with the voice of an archangel, and with the trumpet of God,
and the dead in Christ will be the first to rise.
17After that, we who are alive and remain
will be caught up together with them in the clouds to meet the Lord in the air. And so we will always be with the Lord.
18Therefore encourage one another with these words.