I don't know about abrupt shift...it was flagged up well in advance that many people died trying to obtain the plans of the Death Star. It's mentioned in Episode 4.
However, the original plan wasn't to have everyone die...because they didn't think they would be allowed to go that 'dark'...but it was soon decided that they should.
Gareth Edwards via IO9.com
Speaking with Empire, Edwards was asked if the end of the film—where all of the main characters die—was always the end of the film. It wasn’t. Here’s his response:
The very first version, they didn’t [die]. In the screenplay. And it was just assumed by us that we couldn’t do that. ‘They’re not going to let us do that.’ So I was trying to figure out how this ends where that doesn’t happen. And then everyone read that and there was this feeling of like, ‘They’ve got to die, right?’ And everyone was like, ‘Yeah, can we?’
We thought we weren’t going to be allowed to but Kathy [Kennedy, President of Lucasfilm] and everyone at Disney were like ‘Yeah it makes sense/ I guess they have to because they’re not in A New Hope.’ And so from that point on we had the license.
I kept waiting for someone to go, ‘You know what? Could we just film an extra scene where we see Jyn and Cassian, they’re okay and they’re on another planet?’ And it never came. No one ever gave us that note, so we got to do it.
It is a heist movie essentially, a heroic one, they get the information out...it's just that they don't get away with it.