If the controller executed makes use of runLegacyCallback, things will get ugly.
Real example: Legacy calls a controller which uses eZFind and thus also runCallback.
The culprit can been seen here. First one enters the legacy-directory, and all is good. Then leaveLegacyRootDir() puts the script in the web-directory. The remaining legacy code executed after the Symfony-controller will then be executed within the wrong working directory. This causes all sorts of fun to happen. Crashing code, ini-cache-corruption...
The ini-cache corruption causes the setup-wizard to be displayed; even in an production environment. Needless to say, this is very much unwanted.
The code above should simply store the current working-directory and then restore it.