At a time when mortgage-backed securities were imploding and customers were fleeing the market, a junior analyst at Deutsche Bank AG protested when he was asked to alter the numbers in a spreadsheet to make a Deutsche security look less risky to ratings agencies, according to a person with knowledge of the matter.