The Homeland Security Department missed clear warning signs of a disgruntled federal agent's descent toward violence and could have intervened before he started a gun battle resulting in his own death and the serious injury of another agent inside a government office building in southern California.