I am NOT a lawyer (so probably shouldn't even comment) but I live in a country with similar laws to Italy. Changing one's name is completely impossible in my country, with an exception for trans people. It is one of the rights that they have, that nobody else has. This looks to me like the Italian courts were acting according to the basic principle that changing one's name should be impossible or nearly impossible, and someone has to be 'trans enough' to trigger the single exception.