Actually, Rev.20:8-9 is referring to the post-Millennial age, after Satan is released and sparks a world-wide revolt against Christ.
After this final revolt is put down, then the Great White Throne judgement occurs and then the eternal state, with the New Heavens and Earth. (Rev.21-22).
It would seem that there are two references to Gog and Magog in the Bible.
I agree that there appear to be 2 attacks by Gog & Magog . . . one at the end of the Millenial reign.
I’m not looking at the moment . . . off the top of my head, is Ezek 38’s war the other one? Some believe that may be one of the not too far off . . . “next up” “main events.”