About two weeks after a grisly shooting in a Pittsburgh suburb, Wendy Bell, a local news anchor for WTAE-TV, wrote a public Facebook post that focused in part on finding hope and offering kindness.

But before the offering kindness part, she swerved into racial commentary that led to her being fired on Wednesday.

She was responding to a shooting at a backyard party on March 9 in Wilkinsburg, Pa., that killed five people, including a pregnant woman. No one has been arrested, and the police have not yet publicly identified suspects.

Yet in her Facebook post on March 21, which was later edited and eventually deleted, Ms. Bell played detective in a way that some felt relied on damaging stereotypes.