India lost to NewZealand and not Afghanistan.
It's just a bad luck that the Indian batsmen were not in the form in the start of the tornament and when they gained the form it was already too late. You don't get many chances in tornament like these. Each and every match is important and it's always difficult to come back in the tornament if you lose two early matches with the strong teams.
It was not a bad luck rather Indian team was not well prepared for this mega event. India, NZ and Pakistan need to win at least one match against each other to stay in the tournament but India lost both with huge margins. It's not justified to analyze Indian team performance based on their performance against Afghanistan, Namibia and scotland.