Nazis did something similar to the Jews who fled Germany.
it was still smarter than staying!
You are referring to the Reichsfluchtsteuer.
In the "German Democratic Republic" (now-defunct East Germany), there was also the crime of Republikflucht.
Regards,