Using interpolation of $environment can cause problems when it is used in a fashion that makes a directory based environment behave as dynamic environments. We should help users by making it an error to use this.
It plays a role in dynamic environments in 3.x, so this can not be fixed until 4.0 because it is a breaking change otherwise.
When starting on this ticket, look at the root causes for the problem and come up with what needs to be validated; it may not be just the use of the variable itself.