It used to be very common to see images of pterosaurs having from branches or cliffs with their toes rather like some kind of reptilian bat and this was, for a while, considered plausible or even likely in the literature. It also made it into the original Jurassic Park novel showing a remarkable degree of persistence. However, this has (just about) finally died out and for two rather good reasons. This is, hopefully, a pretty simple example of basic comparative / functional anatomy which is very useful for inferring behaviours and the habits of extinct animals.
Animals that do hang upside down by their hands and feet are few and far between. The two obvious candidates are of course the bats, but also sloths. Both of these share a couple of features in common with their anatomy which are clearly distinct from pterosaurs suggesting rather strongly that pterosaurs were not hanging around in this manner.
First off both of these animals have strongly curved and robust claws on their feet (and hands too for sloths) which can hook around object to provide them with the purchase they need. While some pterosaurs do have some rather big foot claws, these are not really in quite the same league as bats and sloths and the vast majority have relatively short claws with little curvature. As an additional point, pterosaurs do have big and curved claws, but these are on the hands, not the feet.
Secondly these animals also have toes that are all remarkably uniform in length unlike almost any other animal I can think of. This of course really spreads out the load of the animal across multiple toes / claws and doesn’t force all the weight onto just one or two and should give them a stronger and more reliable grip. While the fifth toe is huge in rhamphrhynchoids and massively reduced in pterodactyloids, the others are all fully functional and yet are always different lengths to each other, sometimes with quite dramatic differences.
There is then no good reason to think that pterosaurs would, or even could, suspend themselves effectively upside down with any regularity. While I don’t think it’s been mentioned before their plantigrade foot posture might also be an issue. I’m not sure if they could quite straighten then ankle out to be in a straight line with the tibia and if not then this would put a lot of stress on the ankle and make this a difficult pose to hold, it’s not critical but I’d be intrigued to test that at some point.