Another of my favorites that fits in the "nerd-culture" category is Buckaroo Banzai. That again performed poorly in the box-office but later became profitable and gained cult status.

One that followed a similar trajectory that didn't work for me was Big Trouble in Little China. Director John Carpenter said that was the movie that made him leave mainstream film-making, due to the rejection of what he considered, while unconventional, a very good film. Again a case of a movie that only received widespread recognition long after its release and commercial failure.