Defence chief was warned about legality of military's COVID-