Prayer does not work to cure all diseases and that’s why we use medical doctors and technology to cure disease and ailments.
Thus, if prayer does not work to cure the desire for Sodomy, there are other methods that can be imposed on the Sodomites.
I would prefer to say that prayer is not always the solution to these problems, and God wants us to use all available means to care for the sick, the poor, and the hungry. Still, God does want us all to follow His Word, and it's a shame to steer those in need away from one of the many options.