Hm-m-m… I'm not sure I really understand this. You wrote you may fail classes or semesters but you cover up in the finals?
I see you list yourself as being in India. Perhaps that's why I wouldn't understand what you've written here because I don't know anything about the educational system in India.
Is it really okay to fail? Well... I don't know.
Somewhere I recall reading a quote from someone who said they had learned more from their failures than from their successes. So perhaps as long as you don't make a habit of it, & you're able to maintain the right perspective with regard to it, a few failures along the way in life aren't the worst thing in the world. In fact, they can be learning opportunities.
However, as with anything, it would certainly be possible to overdo it I would guess. At least those are my thoughts with regard to your post.