Oh my, that would certainly freak him out...The fact that his leg is dangling like that means nothing, they all do that while basking, laying, sitting, sleeping, all the time, they do the craziest things with their legs and contort their bodies into the oddest positions that eventually you'll get used to it. So that isn't indicative of a leg injury at all, but I'd put him on flat ground or a flat surface and make him walk, see if he's limping or favoring any limbs or feet/toes, see if he is acting like he's in any pain at all (is he
black bearding?), and just watch him. Hopefully he's just freaked out and shaken up, he should snap out of it quickly as long as he's not injured.
As far as the UVB tube, yes, it must be strapped to the underside of the mesh lid, especially if it's a weaker T8 strength of UVB tube, that's a requirement and not optional at all because the mesh lid will block 40% at least of the already very weak UVb tube, but usually if you just poke 4 holes in the mesh over the Hot Side of the tank, so that the UVb tube with be able to be right alongside the bright-white colored basking bulb, so that both lights are right alongside each other and sharing the top of the Hot Side of the tank (with his basking spot/platform positioned right underneath both lights so he gets both at the same time while basking), then use either long, plastic zip ties, wire, twine, string, shoelaces, etc. to feed through the holes in the mesh and to strap the entire tube fixture to the underside of the mesh lid, then tie them or fasten them on top of the mesh at both ends of the fixture, they won't fall. If you happened to use some type of Velcro or the like, and it got too hot and loosened, etc. then that can happen...