Did Sonny Kill Dr Lanning?

Did Sonny Kill Dr Lanning? Did Sonny kill Dr Lanning? All NS-5 robots immediately revert to their default programming and are subsequently decommissioned and put into storage. Spooner finally gets Sonny to confess that he killed Lanning, at Lanning’s direction, pointing out that Sonny, as a machine, can not legally commit “murder”. Why did Sonny