Yes, the movie made no money, "But it made 300 million dollars!", while nice doesn't mean anything if the movie cost $180 million and the ads cost $150 million then you made no money.
The movie made $319 million worldwide off a reported $150 million budget. Assuming prints and advertising were equal to the film's production budget, it still reached profitability. Add to that ancillary revenues (home video, television) and it no doubt made the studio a healthy (if not overwhelming) sum.
That said, by all accounts the movie was a disaster. I certainly have no interest in seeing it, or any live-action follow-up that is a direct sequel to Shyamalan's movie. I agree with Dennis