I had this bug where the last layer I was tinkering with would go to the bottom after clicking in an empty part of the layer manager, and I've managed to find what causes it.
It seems like the last layer stays somehow selected after clicking it and holding the mouse button for slightly too long made it as if I moved it to the bottom: