The D2 pipe is responsible for getting rid of any water should any safety devices that are apart of an unvented hot water cylinder fail. If it’s fitted incorrectly water could escape causing damage. The scenario in the video below is to common in new builds. As this pipe would only ever be used years after the installation has been completed the home buyer would never question it.
This video also shows an issue with the filling loop.