In The Lego Batman Movie, Joker intentionally went to Phantom Zone so that he can bring all bad guys to Gotham and attack the city.
When Phyllis scanned Joker, she said:
Your whole thing screams "bad guy."
And moments later, Joker sends Batman to Phantom Zone, after that he attacked the city. Batman was requesting Phyllis to send him down to save Gotham. They had this conversation:
Batman: Hold on a second, Brick Lady. I need to get down there and stop this
Phyllis: I can't let you go. My boss will be really mad at me.
Batman: Yeah. But I bet your boss would be happy if you were able to get all those bad guys back in here.
Phyllis: Hmm. She sure would.
Batman: Then let me try. Let me get down there and help them.
Phyllis: But haven't you tried that before? You do the same thing over and over. What's gonna change?
Batman: I know what I need to do. Just give me 24 hours, and I'll come back. You've gotta let me go down there and save them. I'll do whatever you want. Please. Please.
Phyllis: Okay, but I need all the bad guys locked up in here.
Batman: I promise.
Phyllis: And I mean all of them.
That moment itself, Batman realize that he also needs to come back to the Phantom Zone.
But when Batman and his team was fighting with bad guys and sending them back, Why Joker was not sent back to Phantom Zone?