The Supreme Court established limits on the government speech doctrine in Legal Services Corp. v. Velazquez, 531 U.S. 533 (2001).
The Court ruled that a provision — the Omnibus Consolidated Rescissions and Appropriations Act of 1996 — violated the First Amendment’s free speech clause because it was a viewpoint-based regulation of private speech, it interfered with the traditional role of lawyers, and it restricted the access of indigent persons to the resources of the legal system.
https://www.mtsu.edu/first-amendment/article/313/legal-services-corp-v-velazquez