The problem actually happens when deleting the first layer. It was my misunderstanding. But it is solved now, see in the other thread.