Starting point matters a lot here. If you're at a really high bf% and are a novice lifter, recomp is a real thing and you can put on pretty significant LBM while losing weight. I wouldn't recommend blasting gear in this situation because of all the health risks that go along with it, but a TRTish dose, particularly if you're low in the range (and you likely are if you're at a high bf%) can do a lot, and the additional LBM you put on is going to add up on the fat loss side of things as you go through the process, too.
If you're already an experienced lifter and have run cycles before and just let yourself go because life got in the way or whatever, but you still have most of the muscle mass, have still been lifting, etc., recomp is a meme and you should just cut first while not worrying about adding muscle.
Gear isn't going to help you lose weight in any real way except indirectly. If you're in a position to add LBM, that LBM is more metabolically active than fat, and the more you add and longer you go the more that adds up. Nutrient partitioning and lipolysis from AAS and HGH can help with using fat for energy preferentially, but they don't overcome the second law of thermodynamics, and if you free up a bunch of fat for energy that doesn't get used, it just gets stored as fat again. But none of it is going to make a significant direct impact.
Either way you want to stick around TRT levels of gear, but in one situation you can reasonably expect to get bigger muscles and smaller on the scale, and the other you should just be trying to maintain the muscle you have while cutting fat.