Here's the thing: you can discuss whatever you want before the dive, but if your buddy is out of gas - there are some chances that she is close to panic, or already panicked. When in this condition, she is not going to follow any discussion that you previously did, and she is going to grab the first regulator she will see - in her mind, it's a matter of survival.
Agree with that. Despite the "correct" procedure, if I'm OOA - tried taking a breath and nothing happened - there are two different responses I've thought about for myself: 1) If I have enough air in my lungs to get to my buddy or another diver nearby, and I'm calm, I'll give a signal and wait to receive whatever is offered. 2) If I don't have air in my lungs, I believe I would go into some type of survival mode - right after the immediate panic attack - and go for whatever I could grab. It it winds up being someones octo, great - if it winds up being their primary, I hope they remember buddy breathing, if that is still a thing. What I actually do is going to be dependent on how much air I have from that last breath and if I can keep my wits about me. One can say what they think they will do, but when reality sets in, it's a different story.
The only thing I really ever tell an insta-buddy before we go down is that if they are OOA, I will give them my primary, as my setup (travel BC) doesn't use a traditional octo, but rather a very short hose, opposite side of primary, that puts the alternate secondary where no one would notice it. My regular dive buddy has the same type of set up although his is not a travel BC, so we know that about each other. Although, they do happen, and there is a lot to be said about it, OOA is not a common occurrence (according to what I get from DAN reports) that causes death in scuba - maybe just fear thinking about it. That doesn't mean one shouldn't expect the unexpected and prepare as best as possible, such as checking gear and thinking about the what if situations, for a safe dive experience.
Realistically, for my type of diving (boat with DM leading dive), although I have a buddy, we don't generally go down together, stay together, and more times than not (lately), come up together - the opposite of the ideal buddy system. We generally stay within sight of and check on each other. My observation is this is true for many divers. With 5 of the last 7 ops we dove with, we ended up under the boat at the end of dives and could stay down as long as we had air. One of us will generally come up before the other in those cases (tired, cold, bored, low on air, hungry and snacks are onboard.) I'm more concerned about my computer beeping than I am of being OOA.