Exodus 28 describes two separate sets of engraved stones on the High Priest's ceremonial vestments, and onyx belongs to the set most readers overlook. Rather than one of the twelve breastplate stones representing the twelve tribes individually, two onyx stones were mounted on the shoulder pieces of the ephod, the apron-like garment worn beneath the breastplate, each stone engraved with the names of six of the twelve tribes of Israel, so that the priest symbolically carried the whole nation on his shoulders whenever he wore the garment.
This shoulder placement, distinct from the breastplate proper, is the detail that most consistently gets flattened in popular retellings that lump "the priestly stones" into one undifferentiated set of twelve; the text itself is specific that the shoulder onyx and the breastplate's twelve stones served related but different symbolic functions, representation by name grouped in pairs versus representation stone by stone.
Exodus gives the shoulder stones an explicit purpose rather than leaving it to be inferred: they are stones of memorial, engraved with the names of the sons of Israel in the order of their birth, so that Aaron carries those names before the Lord upon his two shoulders. The verb the text uses for what the priest does with them is to bear, the same word used of carrying a physical load, and commentators have generally taken the choice as deliberate.
The breastplate itself carried something the shoulder stones did not, the Urim and Thummim, placed inside it and used in the narrative to obtain a decision. The vestment as a whole therefore combined a memorial function at the shoulders with an oracular one at the chest, which is a further reason the two sets of stones are not interchangeable.