The grammatical error in the sentence is "have."
Since "team" is a collective noun treated as a singular entity in American English, the correct form should be "has" instead of "have." The corrected sentence would be: "The team has been working on the project for several months."