I've never had to share air outside a classroom, but I'm a relatively new diver and mostly done solo.
The OP brings up a point that has been discussed before on SB, will a diver grab the reg out of their buddy’s mouth or follow their training
I'm pretty sure I've heard first-hand accounts of someone pulling a regulator out of a dive-buddy's mouth. I get the sense that it's somewhat rare.
There does seem to be a steady shift away from primary-donate, even if the agencies still teach primary-donate. Since covid, I noticed a few classes mention doing secondary-donate instead for covid-reasons. A number of people I watch on YouTube, like Alec Peirce are vocally against primary-donate. Why take a perfectly good regulator out of your mouth, when you can offer up your brightly-colored secondary. If you don't use regulator-retainers, you might even have difficulty finding your own secondary and get tangled up.
We were at about 100 feet/30 m down on the Duane in the Florida Keys and way far away from our descent/ascent line. He finally showed me his gauge which showed 200 psi.

I still had 2200 psi.
Wow, what a terrible dive-buddy. Probably one of the worst I've heard, because that wasn't an accidental emergency, he deliberately waited.
I think continue a dive while air sharing is dangerous. But I understand, that a DM might feel the pressure to continue the dive. it's a difficult topic. I am interested in other opinions
I mostly agree. It depends on context.
For example, if we assume a non-emergency and just air-sharing to extend a dive, it's maybe ok. For example, lets say Lets say 2200 psi and 900 psi, where you'd want 650 to budget a safety stop and surface with 500 remaining. That's also assuming good visibility and no other risks. You could extend the dive with air-sharing that way. Just watch the air and be VERY aware of hazards. There may still be some other increased risks, for example, entanglement hazards, or one diver gets spooked.
Personally, I silo dive a lot, so if it's an insta-buddy or stranger their bad air-management isn't my problem, unless it's an emergency. So I'd tell them to surface and continue on my way. If there is an equipment failure or similar emergency, the dive is called, even if I had 3200 psi.
It would have to be a close buddy or friend for me to even consider donating air in a non-emergency and dragging them around like a puppy.