I don't think it will stand, but yes, the country is getting crazier and crazier. Technically is about a group of psychiatrists, and digging a little you get the usual religious nuts, that want to "treat" homosexuality and did some sort of legal demand to be able to do it because in Brazil it's actually illegal to do such treatments. The judge let it pass in first instance, but it's not like law, "law" yet.
So, technically, it's not about declaring homesexuality an illness, but it's certainly about opening the path towards that.