I have. Years ago. A friend came to live with me abroad while she looked for a place to live on her own. I was happy and excited. After a few weeks she started to realise it's hard to live in a foreign country, especially when you don't really speak the language. She became (I think) jealous of how easy it was for me (it bloody hadn't been- I'd done the move alone and had been there years - she hadn't seen what I'd gone through). So she started making digs at me ALL the time. Digs about my looks (she's a stunner, I'm not), my hobbies, my friends, my clothes, my work and all the time. I knew what she was going through was hard, and we were friends, so let it go at first. It continued and eventually I told her it wasn't nice. Then she started crying and saying I wasn't being fair, she's had a bad day (or whatever) so how could I tell her she wasn't being nice in THAT day. Every single time I tried to talk to her about it, she cried and blamed me.
Eventually she got her place. I figured it would stop. But it didn't. "Jokes" about my breasts, my hair, my life choices - really derogatory comments. Of course I was also "too sensitive" because "it was just a joke". She did it in front of some of our (by then - they had been mine) mutual friends and they were horrified at what she said to me - i hadn't even noticed what she'd said because it wasn't as bad as what she normally said to me and by this time I believed it was really my fault anyway because she still turned it on me when I ever tried to raise it.
One day I went away for a long weekend without her and realised I couldn't cope. She called about 6 times the first day and I just couldn't pick up the phone. I felt really bad, but I just couldn't face another "joke" about myself. She sent messages too and something in me simply couldn't respond. Same the rest of the weekend. I couldn't cope hearing anything else bad about me, being told it was a joke, being told I was unfair to her and having to deal with her crying (loudly). So I ghosted her, although at that time there wasn't a word for it.
I felt horrible for doing it - truly horrible - and embarrassed, because that's not how I treat people. I didn't know what else to do and it was instinctive by that point. I knew it wasn't nice but I still couldn't make myself re-enter the situation where i was going to be humiliated again.
We're in touch now, years later, and we've never spoken about it. I would like to apologise but I can't if I'm going to be told how much it hurt her with no acknowledgement of what she did too (which I'm fairly certain I wouldn't, or I'd have apologised). I think - as I did then - that it was down to the extreme stress she found herself in, while living with me who seemed to have a nice flat, good job, understood a lot about what was going on around etc. If we hadn't been living together at that point it probably wouldn't have been so bad.
I've never done it to anybody else and definitely wouldn't recommend if there's an alternative.