The problem was certainly not the cast, who have all proven themselves to be absolutely incredible. It was Paul Feig running his set like a fucking improv class instead of bringing strong ideas and writing and vision to the table. "At a certain point I had to just let the actors take over" was a quote of his I remember. No you didn't, Paul. You didn't have to do that at all. Because actors with no direction are going to just toss off cheap gags that work in the moment -- puns, dancing, rambling awkwardly about something "in character."
I once heard Seinfeld describe how he hated when comedies would have scenes that forgot to have a funny premise. "Why are we at the DMV?" "Oh because we need to set up that he knows this thing..." No, the entire reason that scene is taking place needs to be funny. That's what caring about a comedy script looks like. "Let's have them kinda hang around the office and one of them will say something naughty or awkward or gross" does not cut it.
It's a shame because each of the cast members separately have absolutely slayed it in other work, and they have worked together brilliantly and shown they have chemistry. So there's really no one to blame but Paul Feig.