The Flash had an extremely popular nine season TV series with 184 episodes that ended just before this movie came out. 

Not to mention, Batman was heavily marketed for this movie.

There’s a lot of reasons it didn’t succeed and this is toward the bottom of that list.