Ms. Grande apologized on Twitter for being “insensitive” and Mr. Davidson supported Mr. West on Instagram.

“No one should ever point fingers at you for your bravery in speaking about mental health,” Mr. Davidson wrote. “I’m seriously disgusted.” Shortly after, Mr. Davidson posted the alarming remarks that led others to worry about his well-being.

Ms. Grande, in a comment later deleted from Twitter, seemed alarmed and apologized for “a dumb joke.”

In another comment on Twitter that was also deleted, Ms. Grande added: “I’m downstairs and I’m not going anywhere if you need anyone or anything. I know u have everyone u need and that’s not me, but i’m here too.”

Mr. Davidson has been open about his struggles with borderline personality disorder.

“I’ve spoken about B.P.D. and being suicidal publicly only in the hopes that it will help bring awareness and help kids like myself who don’t want to be on this earth,” he wrote on Instagram this month. “No matter how hard the internet or anyone tries to make me kill myself. I won’t. I’m upset I even have to say this.”