The code that logs the master failure error was not working correctly after the changes done for MXS-359 and MXS-1503. Updated the logic and converted impossible cases into debug assertions.