Hello
Yes it is legal but instead of doing class 11th again you should have done class 12th and in this way you wasted an year.
I believe there won't be any problem except for the age difference that you might face in different exams although if you belong to reserved category then you would ge age relaxation.
Hope it helps.
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile