I agree that India did not do as well in the 1965 war as it could have. Indian leadership was stupid to trust the Chinese (resulting in the 1962 loss) and the Pakistanis. Moreover, India was rebuilding its military after the 1962 loss to China.
However, this changed once Indira Gandhi came to power. She believed in taking the fight to the enemy’s camp and the result was the creation of Bangladesh in 1971. If the US had not heard Pak’s pleas in 1999 and made the withdraw, the end result would have been much worse for Pak.