How can I make Android 6 quick settings show up in the same layout when the screen is locked?
The elements that have been hidden from your lock screen are hidden for a purpose. Sensitive toggles are not displayed in order to increase the lock screen security.

Due to this, your phone, in unlocked condition shows more toggles than in locked condition. This changes the position of certain toggles and hence your flashlight toggle is moved.

It can be a little inconvenient but you need to live with it since it is making your device safer. Safety by design.