Hollywood and the film industry in general are often defined by their massive hits and their pathetic flops. For many people, this is how they tell the difference between a good and bad film, but this is very inaccurate. A film can still be considered a beloved and memorable classic, even if it was a box office bomb and vice versa.
One of the greatest examples of a box office bomb that became a classic I can think of is "The Iron Giant". "The Iron Giant" was released in 1999 and was a massive commercial flop. The film made about 30 million dollars against a budget that was anywhere between 50 to 70 million dollars. You would think that because of this "The Iron Giant" must have been a terrible film that was panned by critics, right? That was actually the farthest thing from the truth.
"The Iron Giant" was beloved by most critics and audiences (the ones that actually went to see it). The film went on to win several awards, including the animation awards known as the Annie Awards. The film also has longtime devoted fans who saw it as children and now pass the film on to their children. This caused the film to grow in popularity over the years and has now become an animated childhood staple.
It's interesting to watch a film go from an apparent failure to one of the most beloved children's film of our time, to the point were it got a theatrical re-release and a special anniversary edition blu-ray set (which I own, of course). A film that, by any other circumstance, should have been long forgotten, is one of the most memorable animated films of all time.
This is because art doesn't always live or die by what's popular now. Films that were divisive or considered terrible back when they were released can go through a critical reevaluation over several years and be considered classics today. The best examples of this are "A Clockwork Orange", "The Shining", and "Star Wars: The Empire Strikes Back". Box office is often a brief signifier of success.
Box office determines what trends are popular in the here and now, however we all know that trends can change with time. A film (and art in general) needs to learn how to stand on its own merits of story and character and hope audiences will connect with it. Some of the best art that survives to this day survived on quality direction, story, characters, and theme. While making art, one should believe in their own convictions and make something that speaks to the deeper emotions we all have in us as human beings. If your art fails financially, that shouldn't discourage you to much, because you never know if that art might come back in a big way in the years to come. Financial success is only a temporary thing in the art world, the real test comes from the quality of your art and whether it can stand the test of time.