Was there any case of a homosexual priest in the early Church and how did the Church handle that (if it occurred)?
St. Basil and Pope St. Siricius (4th cen.) condemned sodomy among those in the religious life.*
*cf. pp. 41-42 (PDF p. 68-69) of Randy Engel's Rite of Sodomy (vol. 1).
In the times of St. Peter Damian (11th cen.), too, the Church has had to deal with the sin of sodomy, which is closely related to the sin of usury, a fact Dante (14th cen.) noted when he put sodomites and usurers in the same circle of hell in his Divine Comedy*, as there is a close connection between sexual and financial sins.**
*Seventh Circle (Violence), ring 3 "sins against nature"
**They both involve sterile transactions; cf. Catholic historian E. Michael Jones's Barren Metal: A History of Capitalism as the Conflict between Labor and Usury or "Bankers & Wankers".
VII. On rectors of the Church who are soiled with their spiritual children
IX. Just as is the case with those who violate nuns, a prostitutor of monks must be deposed in accordance with the law
X. That both he who falls with his carnal or spiritual daughter, and he who is soiled with his penitential son, should be accountable for the same offense
XVI. Of clerics or monks who persecute males
The following (or similar) law was observed in the Church even before its codification in 1917:
§ 2. If they [clerics] engage in a delict against the sixth precept of the Decalogue ["Thou shalt not commit adultery", which forbids all sexual sins] with a minor below the age of sixteen, or engage in adultery, debauchery, bestiality, sodomy, pandering, incest with blood-relatives or affines in the first degree, they are suspended, declared infamous, and are deprived of any office, benefice, dignity, responsibility, if they have such, whatsoever, and in more serious cases, they are to be deposed.