Donald Trump whipped up another rowdy ovation from a friendly crowd this week with an attack on the media, accusing journalists of being “very, very dishonest” and refusing to give him credit for his purported achievements.

But rather than the usual sports stadium packed with partisans in red baseball caps, this tirade against the press was applauded by dozens of senior law enforcement officials in the splendour of the East Room of the White House.

The episode unfolded on Wednesday afternoon, after the New York Times published an article by an unidentified senior Trump administration official who claimed to be one of many working to thwart Trump’s “worst inclinations” and frustrate his agenda.

Some figures in law enforcement were dismayed by the sheriffs’ response to Trump’s remarks.

“They are supposed to be leaders, not puppets who cheer attacks on the media,” said Michael Bromwich, a former federal prosecutor. “A shameful scene.”

A review of coverage produced by regional media outlets over recent years found that many of the sheriffs who cheered the president have come under sharp scrutiny from the press for their own actions – or for those of the officers in their departments.

They have been held accountable by local journalists for incidents including the leaving of a service pistol in a casino bathroom, alleged mistreatment in jails, the wearing of blackface by an officer, and various other actions.

Here, the Guardian has compiled some of the notable reporting on the sheriffs who appeared with Trump:

1. Sheriff Ana Franklin, Morgan county, Alabama

Ana Franklin. Photograph: Morgan County Sheriff's Office

Franklin is under investigation by the FBI and state authorities after a local news blogger, Glenda Lockhart, disclosed last year that the sheriff used $150,000 in public money to invest in a now-bankrupt used car dealership that was part-owned by a convicted fraudster. The money was taken from a fund meant for feeding inmates in the county jail.

The sheriff’s office recruited Lockhart’s grandson as an informant as they attempted to find a source leaking information to the blogger. The grandson said he was paid to install spyware on Lockhart’s computer. Franklin’s deputies raided Lockhart’s home and seized her computer. Franklin was found by a judge to have broken the law.

Lockhart’s findings have been built upon by several local reporters, including WAAY-31 television’s investigations team and the Decatur Daily. In a statement posted to Facebook in April, Franklin incorrectly described the stories about her as “misinformation, false reports and slander”.

2. Sheriff Thomas Hodgson, Bristol county, Massachusetts

Thomas Hodgson. Photograph: Bristol County Sheriff's Office

Hodgson recently claimed he was the victim of a “witch-hunt”, after the Massachusetts attorney general called for an investigation of suicides and mistreatment in his jails, in response to findings by the New England Center For Investigative Reporting.

Other media, including the Boston Globe, have highlighted a series of controversies around Hodgson’s actions in office, such as his attempts to charge inmates $5 a day for being locked in his jail and the placing of prisoners with mental health problems in solitary confinement.

An attorney for Hodgson’s daughter, Michelle, complained that she received unfair media attention in 2014, when she was arrested and charged with witness intimidation. Then 29, Michelle Hodgson was accused of interfering as police tried to deal with a late-night mass shooting, asking “Do you know that my father’s the sheriff?” and threatening to have an officer fired as she was detained. She pleaded not guilty and the charges were dropped.

3. Sheriff Sharon Wehrly, Nye county, Nevada

Sharon Wehrley. Photograph: Nye County Sheriff's Office

In May this year it was reported by KTNV News that Wehrly left her Glock .45 service pistol in the bathroom of a casino. It was discovered by a cleaner. Wehrly, who could not immediately recall what day the incident had occurred, told a reporter it was not the first time she had mislaid her weapon. She later apologised for the mishap.

The local station also uncovered a series of false statements made by Wehrly’s office about the fatal shooting of a family dog by one of Wehrly’s deputies, leading to an internal investigation.

Wehrly also attracted coverage from the Las Vegas Review-Journal for publicly funded recruitment billboards that critics alleged were election campaign signs in disguise. Wehrly said the signs were within the rules and were approved by ethics regulators.

4. Sheriff Scott Jenkins, Culpeper county, Virginia

Scott Jenkins. Photograph: Culpeper County Sheriff's Office

Jenkins’s department was the subject of a deeply reported investigation last November by the investigations team at WRC-TV. Former deputies told reporters the office suffered from “chaos, bullying and turnover problems” and accused Jenkins of creating a hostile environment. Jenkins vehemently denied the allegations.

The Culpeper Star-Exponent followed up on WRC-TV’s finding that Jenkins flew first class while travelling the country for work. Jenkins said the county was reimbursed by inmates paying fees and asked: “Have you seen the size of coach seats?”

Other regional media, including the Fredericksburg Free Lance-Star, closely followed a lawsuit brought against officials including Jenkins by a wrongfully convicted man who was freed after serving 12 years in prison for a murder he did not commit. Jenkins was accused of suppressing evidence during the investigation, which he denied. The lawsuit was settled.

5. Sheriff Todd Richardson, Davis county, Utah

Todd Richardson. Photograph: Davis County Sheriff's Office

Richardson was sharply criticised in January this year by the editorial board of the Ogden Standard-Examiner, which accused him of abdicating “his financial responsibility to Davis county taxpayers” and openly defying the rules on running his department.

The newspaper earlier reported that the sheriff was found by county auditors to have approved a deputy’s bogus time cards, paid out questionable travel expenses for deputies and mishandled money that relatives sent for prisoners at his jail.

In May this year, Richardson apologised for a harassment scandal in his department, which was closely followed by reporters at KUTV.

6. Sheriff Wayne Ivey, Brevard county, Florida

Wayne Ivey. Photograph: Brevard County Sheriff's Office

Deputies working for Ivey have repeatedly attracted bad press this year. In March, one was charged with drug and child neglect offences after officers investigating reports of screaming and gunfire at his home discovered cocaine and bullet casings. In May, three deputies were charged with driving drunk while off-duty.

As the Guardian reported during Trump’s 2016 election campaign, Ivey retired as a state law enforcement officer in 2011, three days after he was accused by a local muckraking website of making a threatening telephone call to a female probation officer who was the ex-fiancee of Ivey’s son, Robert.

Ivey denied wrongdoing. A review by the Florida department of law enforcement (FDLE) said no complaint had been made by the female officer, and that because Ivey was no longer employed by FDLE, the case was out of the department’s hands.

7. Sheriff Danny Diggs, York-Poquoson county, Virginia

Danny Diggs. Photograph: York-Poquoson County Sheriff's Office

In November last year, Diggs reassigned a deputy who posed in blackface while dressing up as Frederica Wilson, a Democratic congresswoman who was lambasted by Trump for revealing the president told a constituent that her husband, a US soldier killed in Niger, “knew what he signed up for”.

Diggs said he was disappointed that local members of the National Association for the Advancement of Colored People (NAACP) revealed the incident to the media rather than continuing to address it privately with his office. The controversy was covered by the Williamsburg and Yorktown Daily, and the Daily Press of Newport News.

8. Sheriff Paul Bailey, Berrien county, Michigan

Paul Bailey. Photograph: Berrien County Sheriff's Office

Bailey’s office was the subject of an investigation by ABC57 television into allegations deputies mistreated and sexually abused female jail inmates. The series led to a total of 19 women making accusations against seven guards or former guards.

Three deputies resigned and one was charged with offering money for prostitution, to which he pleaded no contest. A lawsuit brought by 10 of the women was dismissed in February this year after a federal judge ruled that the statute of limitations on their allegations had passed.

Bailey told south-west Michigan’s Herald Palladium following Wednesday’s meeting at the White House that he shared Trump’s displeasure at “some media not telling the truth”.

9. Sheriff Mike Lewis, Wicomico county, Maryland

Mike Lewis. Photograph: Wicomico County Sheriff's Office

In October last year, a hastily deleted Facebook post by Lewis was reported by WBOC television, generating controversy in south-eastern Maryland.

In the post, Lewis railed against African American protesters who demonstrated at a Baltimore Ravens game, accusing them of “refusing to accept responsibility for your own failures and your own perceived inequities”. Lewis said protesters claiming to be the victims of injustice would succeed if only they would “get off [their] butt and WORK for it”.

10. Sheriff Steve Reams, Weld county, Colorado

Steve Reams. Photograph: Weld County Sheriff's Office

Reams’s department became the subject of a criminal inquiry in 2015, after a local news reporter’s investigation led to a former deputy being charged with the murder of his wife, whose death three years earlier had been ruled a suicide.

Former deputy Tom Fallis was arrested after reporting by KDVR found evidence linking him to his wife’s fatal shooting was misstated or omitted during the original police investigation. Fallis was eventually acquitted after a trial.

Several of Fallis’s colleagues arrived at the scene after the shooting. KDVR reported that Reams, then the office’s chief of public safety, “ordered his top commander Paul Wood to the Fallis scene and that Wood gave the orders, and the deputies followed them”. Reams denied any wrongdoing in connection with the incident.

Two of Reams’s deputies were later fired amid allegations officers did not give a full account of what happened. An attorney for one questioned how it could have taken so long for Reams to discover information had been withheld. “Imagine a sheriff who doesn’t know this for three years,” said the attorney, Rick Blundell.