Tommy Chong created a pilot for CBS called "The Martinez Family", about a reformed Latino gang member turned trial attorney who moves in with his family in East L.A. CBS liked the concept, but wanted to change it from a family sitcom to a buddy comedy, so it was redeveloped as this.
Paul Rodriguez thought the original title, "Amigos", was too stereotypical, so it was changed to "Trial and Error".