In the process of searching for more details, I found the story in question, The Lifecycle of Software Objects by Ted Chiang.
"The Lifecycle of Software Objects" follows Ana Alvarado over a twenty-year period, during which she "raises" an artificial intelligence from being essentially a digital pet to a human-equivalent mind.
Ana, a former zoo trainer, is hired by a software developing company to assist in the training of digital creatures, named digients in the story, that are designed with a learning capacity similar to human children. Ana helps with the training and forms a close bond with Derek Brooks, a designer in charge of creating the visual appearance of the digients.
Blue Gamma releases the digients in a virtual reality platform named Data Earth with a big initial success, but after several years, the popularity of the digients diminishes and Blue Gamma closes. Several of the employees form a group to keep active the digients active and learning; Ana keeps one named Jax and Derek keeps two named Marco and Polo. During these years, Derek develops unrequited feelings for Ana.
After a few more years, the platform of Data Earth closes and merges with another digital platform named Real Space. Most of the games and software have already an equivalent there, but the digients don't because Blue Gamma closed before the launching of Real Space, which means they remain isolated at private servers running Data Earth. Ana, Derek and the other owners mantain a flow of learning activities for the digients, but they are unable to provide enough social interaction for them unless they can port them to Real Space, which prevents them to continue developing as social beings.
Ana receives an offer from another digient manufacturer, that wants her to train their digients to become personal assistants. She considers it an opportunity to convince them to invest on the digients she has been training, but the job offer has the downside that she would have to get her brain chemistry altered to reinforce her commitment to her work. On the other hand, the group receives an offer by a marketer of virtual sex dolls, that offers to pay for the port of the digients to Real Space in exchange of copies of the digients to train them as sex partners for their clients.
Marco and Polo are intrigued by the offer, but Ana takes a strong position against it and instead prepares to accept the job offer. Upon learning that, Derek allows himself to be convinced by Marco to accept the offer of the sex doll company and sells them a copy of Marco, even if he knows that this will destroy any chance he has with Ana.
Ana finds out and cuts all ties with Derek. In the final scene, she is working on the education of Jax and meditates on the possibilities he will have at life, although she can't help feeling down because of the high price that was paid.
A copy was available on the Subterranean Press's website and is still accessible via the Internet Archive.
The clown scene:
On the virtual television, a person wearing a clown avatar is holding down a digient wearing a puppy avatar, and hitting the digient’s legs repeatedly with a hammer. The digient’s legs can’t break because its avatar wasn’t designed to account for that, and it probably can’t scream for similar reasons, but the digient must be in agony, and the chittering sounds are the only way it can express that.
Ana turns the virtual television off.
“What happen?” asks Jax, and several of the other digients repeat the question, but she doesn’t answer. Instead she opens a window on her physical screen to read the description accompanying the video that was playing. It’s not an animation, but a recording of a griefer using the IFF hack to disable the pain circuit-breakers on a digient’s body. Even worse, the digient isn’t an anonymous new instantiation, but someone’s beloved pet, illicitly copied using the IFF hack. The digient’s name is Nyyti, and Ana realizes that he’s a classmate in Jax’s reading lessons.