This is not worth even 1% risk. You've obviously seen the videos of people being tossed off buildings. Many people are very happy living in Islamic theocracies, but that does not usually include the LGBT crowd. Fly via Amsterdam or Frankfurt or London or any number of other non-Middle Eastern countries. Transiting should be fine. Until it isn't. But why experience any potential hassle. Pony up a few more bucks and be safe and sure.
Qatar and the UAE aren’t theocracies, as anyone with an informed, objective understanding of forms of government would know.
Lots of South Asian LGBT passengers pass thru DOH and DXB on trips to/from/within Asia, almost always without incident; and most any incident of a problem while transiting wouldn’t be unique to transiting DOH or DXB and may have its own variant in the UK or US airports.