I came across this example sentence and was wondering whether it's grammatically correct and if it is, how the といって functions as a grammar point in this sentence. There's another related question on this site that seems to indicate that といって=と言って, and is similar to the grammar X という Y = "A thing X called/identified as/that is Y," as in 雪国という小説 = a novel called Snow Country. Here, it also seems like it modifies the phrase that comes before it in a way that is derisive. Is this correct?
上司は会社の電話で私用の電話をかけたと言って私をひどくしかった。
My boss scolded me for making (so-called?) private calls on the office phone.