Each layer creation will randomly initialize the parameters (if available) and will thus call into the pseudorandom number generator. If your training is sensitive to different seeds, these additional layer creations can change the training results significantly and you should see the same effect by removing the layer creation and just changing the seed at the beginning of your script.