No, this was not the failure of foreign policy but this was a result of international situation:
1. The Chinese Invasion 1962:
(a) Serious conflict arose when China annexed Tibet in 1950 and removed a historical buffer between two nation, and India did not oppose this openly.
(b) India grew uneasy, when China began to suppress Tibetan Culture.
(c) Another border dispute arose when China claimed Aksai Chin area and NEFA (much of the state in Arunachal Pradesh) within the Indian territory.
(d) Despite long term correspondence and discussions, these issues have not been resolved even by top leaders of country.
(e) Hence, India had to indulge in the conflict.
2. War with Pakistan:
(a) A serious armed conflict between two countries began in 1965 with the initiative of Pakistan over Kashmir partition.
(b) In 1966, the hostilities came to an end with the UN intervention and Tashkent Agreement signed between Indian Prime Minister Lai Bahadur Shastri and Pakistan’s General Ayub Khan.
(c) The 1965 War added to India’s already difficult economic situation.
3. Bangladesh War of 1971:
(a) In 1970, Pakistan faced its biggest crisis in the way for a split verdict i.e. Zulficar Ali Bhutto’s Party emerged as winner in West Pakistan while Awami league led by “Sheikh Mujibur- Rehman” swept through East Pakistan.
(b) The Bengali population of East Pakistan had voted to protest against discriminatory attitude of West Pakistan, which was not acceptable to West Pakistan rulers.
(c) In 1971, Pakistani army arrested Sheikh Mujib and unleashed a region of terror on East Pakistan. This started people’s struggle to liberate Bangladesh from Pakistan.
(d) India had to bear 80 lakh refugees who fled from East Pakistan to take shelter. Hence, India had to extend moral and : material support to the freedom struggle in Bangladesh.
(e) A full scale war between India and Pakistan in December 1971 broke out, when Pakistan attacked on Punjab and Rajasthan to be retaliated an attack from India.
(f) Within ten days the Indian army surrounded Dhaka and Pakistan had to surrender with Bangladesh as a free country, India declared a unilateral ceasefire and Shimla Agreement was signed between India and Pakistan in 1972.
(g) Most people in India saw this moment as a glory of India and a clear sign of India’s growing military powers.