Odds are, the first castrati was an accident -- a boy singer who lost his ... er ... package through misfortune, and whose voice did not change thereafter.
My guess is that the effect was widely known in ancient times, because there were many eunuchs. Since boys often died after being castrated, a mature eunuch was a prized possession and a handsome gift to give another king or emperor.
The difference seems to be that there was a demand in Italy for the voices, which made castration a path to fortune for a few. There was a movie about Farenelli, called Farenelli (oddly enough).