There's a couple different ways those messages are constructed.
For the top-level close reasons (off-topic, too broad, unclear, duplicate, opinion-based), the reason chosen is whichever reason had the most votes. In the case of a tie, it chooses the most recent vote that was one of those choices to break the tie.
Now, there are off-topic sub-reasons. Any sub-reason which gets at least 2 votes is always shown regardless of which one is chosen as "final" because the off-topic reason can list multiple sub-reasons. Due to the number of close votes, that means two different sub-reasons could be displayed. However, custom off-topic reasons are not allowed to appear in the close notice box. They will remain as a comment. If no other sub-reason receives at least 2 votes, then only the base off-topic message will be displayed.
Of course, a moderator close vote overrides both of these situations (overrides the close reason and their chosen off-topic reason only needs the 1 vote instead of 2).
In your particular case, all five users chose the off-topic top level reason, so the question was obviously closed as off-topic. Three of you chose a custom reason which cannot ever be displayed in the notice, and two selected a provided reason so it got displayed in the notice. It's nothing to do with the system choosing the minority. If the three of you had simply selected a different provided sub-reason, then both would have appeared in the box.