Not on UA, but it has happened to me occasionally on AA -- although only from J to F (so only on their small group of 3-class planes). Most recently got a courtesy upgrade on LHR-DFW last week.
Asked the lead GA if there was empty space in F, and she said "let me see." No one on the waitlist. A few minutes later she came to me with an 1-D boarding card. She did not deduct a SWU although I offered to use one.
I've never had a courtesy upgrade on any carrier Y to J (and only rarely an Op-Up).