Ra.One is the 10th highest grossing Bollywood movie worldwide. When it released in 2011, it was the third highest grossing Bollywood movie of that year.
I don't understand by what standards can it be called a flop. Clearly it is just a false perception. Shahrukh still refers to it as not doing well because of the way it was responded to both by the audience and the critics. But commercially, it did exceptionally well.
And like the others have mentioned, the script turned out to be the sour point. Technically and VFX wise, it was the most advanced Bollywood film to be made.

4