Security errors, lapses and missed opportunities to stop a gunman led to the first shooting of a U.S. president or former president in more than a generation.