In Ezekiel 12, God tells Ezekiel to act out a prophecy for the people to see. It is true that Ezekiel and the people who witnessed his actions, were in captivity, but not all the Jews were exiled from Judah at this stage. This prophecy was aimed at the prince and the Jews in Jerusalem . Doubtless, the prophecy would have been told to the Jews back in Judah, perhaps by messenger, perhaps by letter. The verses below explain the subject of the prophecy – ie King Zedekiah and the Jews dwelling in Jerusalem.
Ezekiel 12:10-13 Say to them, ‘Thus says the Lord GOD: This oracle concerns the prince in Jerusalem and all the house of Israel who are in it.‘ (11) Say, ‘I am a sign for you: as I have done, so shall it be done to them. They shall go into exile, into captivity.‘ (12) And the prince who is among them shall lift his baggage upon his shoulder at dusk, and shall go out. They shall dig through the wall to bring him out through it. He shall cover his face, that he may not see the land with his eyes. (13) And I will spread my net over him, and he shall be taken in my snare. And I will bring him to Babylon, the land of the Chaldeans, yet he shall not see it, and he shall die there.