The third part is a complete change in tone, but it is actually necessary for the entire book because without it the ending would be implied to be extraordinary bleak.
More authors should be brave and have their stories end bleakly.
Great examples that come to mind would be 'Death's End', 'Echopraxia' (to a lesser extent also the prior 'Blindsight'), 'Consider Phlebas', just to name a few.