I am not sure impersonating a member of airline personnel is, in itself, any kind of crime.
It is, if you obtain an economical advantage from it such as free passage, which happened allegedly at least once in this case. Not to mention the security aspects if you manage to get into a restricted area, such as the apron or even worse the flight deck, under such false pretenses.
Edited to add: in Italy it's illegal per se even without monetary gain, that is only if it's a legally licensed and regulated profession such as doctor, lawyer or, as in this case, airline transport pilot.
Ciao,
Dg800