K-2SO gets captured by the Empire. He possesses a lot of valuable information about the rebellion and he knows that a rescue in time is unlikely. But it's okay, he has a emergency subroutine just for this kind of situation that allows him to destroy his memory core. It'll wipe everything and reset him to factory status but it's better than letting the information he has be used against Cassian and the rebellion.
When Cassian finally gets to K-2SO because he would've never left his only friend behind there is nothing left of him.
Cassian &/ K-2SO, memory wipe
When Cassian finally gets to K-2SO because he would've never left his only friend behind there is nothing left of him.