Concerning the new heavens and the new earth, Revelation 21:22-27 and Revelation 22:14-15 should be interpreted in view of Revelation 21:7- 8
Revelation 21:22-27 says:
I did not see a temple in the city, because the Lord God Almighty and the Lamb are its temple. The city does not need the sun or the moon to shine on it, for the glory of God gives it light, and the Lamb is its lamp. The nations will walk by its light, and the kings of the earth will bring their splendor into it. On no day will its gates ever be shut, for there will be no night there. The glory and honor of the nations will be brought into it. Nothing impure will ever enter it, nor will anyone who does what is shameful or deceitful, but only those whose names are written in the Lamb’s book of life.
Revelation 22:14-15 says:
Blessed are those who wash their robes, that they may have the right to the tree of life and may go through the gates into the city. Outside are the dogs, those who practice magic arts, the sexually immoral, the murderers, the idolaters and everyone who loves and practices falsehood.
Revelation 21:7- 8 says:
Those who are victorious will inherit all this, and I will be their God and they will be my children. But the cowardly, the unbelieving, the vile, the murderers, the sexually immoral, those who practice magic arts, the idolaters and all liars—they will be consigned to the fiery lake of burning sulfur. This is the second death.
Nothing impure will enter, nor anyone who does shamefully or deceitfully because they will be condemned to the lake of fire.
Those who are considered dogs, and those who practice magic arts, the sexually immoral, the murderers, the idolaters and everyone who loves and practices falsehood, are “outside” the city because they are condemned to the lake of fire.
These verses are not telling us that there will be holy people living in a holy city, while the wicked are on the other side of the wall in the new heaven and new earth, but rather those who are “outside” the city are banned to their punishment which is the lake of fire.