I don’t have the sentence that the OP is using, but I think I can describe the concept.
There are two sentences involved - a sentence for the fact and a sentence for the role, and it’s a two way street. The fact sentence can contain the names of the people with the roles, and the role sentence can contain the name of the person with the fact.
I’ll give a different example than the one from the OP. Suppose you wanted to list the name of the midwife (if known) on a person’s Birth fact. You would share the Birth fact with the person who was the midwife using role of Midwife. The sentence for the Birth fact might be something like the following (and I’m making no effort to get every detail of the sentence just right - it’s just an example of the concept).
[Person] was born [Date][Place].<The midwife was [Midwife].>
Now suppose there were two midwives and you shared this birth fact with both of them. In that case, the single [Midwife] variable would expand to both of them. But if you were expecting that ever to happen, then you would need to put some effort into making the sentence smarter to include plural switches so that it could automatically say “The midwife was …” or “The midwives were …”.
As to the thrust of this question, my experience is that when there are multiple people with the same role, they are listed in reports in the order in which the were shared. That’s where it gets tricky.
You can share people one at a time for a fact, in which case you get to choose the order. You can choose the same people for the same role for different facts and the order can be different if you did the sharing in a different order for the other facts. If you get the order wrong, there is no way to fix it except to delete the shares and to put them back in, this time in the correct order.
You can share people all at the same time for a fact, in which case you do not get to choose the order. In this case, the order is based on the RIN numbers of the people being given the roles. For that reason, I never share people with the same role all at the same time. For whatever reason, I care mightily about the order. So I do the sharing one person at a time, even though it’s more work to do it that way.
I actually make very little use of shared facts. I generally speaking prefer separate unshared facts for each person. My chief exception is that I have a Parents fact which is shared with each of the person’s parents. To make my reports consistent, I always share with the father first and the mother second. I use the same role of [Parent_of_Child] for each parent. I could have made separate roles for [Father] and [Mother], but I prefer the sentence structure when both parents are in the same sentence with the same role.
Back on the concept that there are two sentences involved. I have a very simple use case. But I can imagine use cases where a fact is shared and the people with the role show up in the fact sentence and there is no role sentence. And vice versa, I can imagine use cases where a fact is shared and the people with the role do not show up in the fact sentence but where there is a role sentence. It’s a very flexible tool, and sometimes you need to be flexible and creative in the way you use it.
But just to repeat my experience, the order in which multiple people with the same role are listed in reports as based on the order in which I did the shares. I can even see using SQlite that the order shows up implicitly in RM’s WitnessTable where the witnesses for each event are stored. Multiple people with the same role for the same fact are stored in WitnessTable in the order in which I did the shares.
For whatever it’s worth, but my fact sentence for the my Parents fact is extremely simple.
Parents:< [Parent_of_Child].>
However, the role sentence is a little more complicated.
Birth of Child: <[Date:plain]><, [Person:Full]><, [Place:Plain]><, age of <%ThisPerson%father|mother>: [ThisPerson:age:plain]>.
It’s hard to tell on this forum, but both sentences start with a carriage return (Enter key on a Windows machine) to cause the fact to start on a new line. The … tags cause the name of the fact or role to print in bold.
The role sentence has the really nice effect of creating a “Birth of Child:” item in each person’s timeline, along with items such as Birth, Marriage, Death, and Burial. It’s a very nice effect in narrative reports that I print out for family reunions. You can see the same information as an option in the Edit Person screen, but seeing it on the Edit Person screen does not get it into narrative reports in the person’s timeline.
Finally, as to your question as to why the order might be different for two different facts in your use case: I believe my description of how it works is correct. So my guess is that you might have done the shares one at a time for one of the facts and all at the same time for another of the facts. For example if there were three sons, you might have shared two of the sons at the same time and the other son separately on one fact and then have shared all three sons at the same time on the other fact. It’s certainly possible that my understanding of the ordering may be incomplete, but I have never seen an exception to the ordering rules I have described. After doing the sharing, it can be almost impossible to remember the exact order you used for the sharing.