jakersey,
The GUI and CLI build the topology based upon the neighbor relationship starting from the perspective of member 0. It has no knowledge of physical placement as in switch 0 is on top, then switch 1 is in the middle and switch 2 is on the bottom.
Putting the role of the switch aside for a moment (e.g. primary, secondary, linecard), the way to ensure proper numbering and the easiest is how you described so I'm unclear of where it went sideways. What you want to do is power on the 1st switch and it will become member 0. Before powering on any other switches, go ahead and configure this switch including a stack-profile and save it. Here is an example of one:
!
stack-profile
member-id 0 election-priority 255
member-id 1 election-priority 255
!
Remember to save the config. Then power on the second switch, this switch should then become member 1. A short period of time later, go ahead and power on member 2.
Now to correct the switches already in deployment, you can use the "set stacking renumber" or "set stacking swap" commands to correct the member IDs.
Regarding the roles of the switches, by using an election-priority of 255, means that these switches will either be primary or secondary and all other switches will be linecards. I recommend the usage of 255 for both as that eliminates pre-emption should the primary fail.
Best regards,
Madani