I have no idea what the death of Cornwell was supposed to bring to the story. If they wanted to show sacrifice they could have focused on all the people dying out there on the battlefield.
The “Someone has to stay behind and push the button from inside” trope has been done so many times. It didn’t feel very original and was so separate from the main story.
I don’t know what they wanted to accomplish but for me it felt like a squandered death. An unnecessary waste of an interesting character.