The JF-17 isn't underpowered, various reputable sources have quoted respectable values for t/w, I'd say the difference in value is largely due to no reference to load-out or even fuel amount. Even 50% fuel vs max fuel will vary t/w wildly.
And it does not in any case need a t/w of 1 in order to do a vertical climb or loop. At any given time the four forces acting on an aircraft would be weight, thrust, lift and drag. When vertical, lift doesn't matter, and even a parity thrust to weight ratio doesn't account for drag, which you might not care about in a vertical climb, but in a vertical loop, air resistance is higher with higher AoA. Let's forget that for a second then, no drag and no lift, a thrust to weight ratio of less than 1.0 would mean that the aircraft can't
accelerate when vertical. Even if it can't accelerate due to a t/w of less than 1.0, it means it will decelerate in a vertical climb where no other forces are considered.
If the aircraft has enough kinetic energy and momentum before it goes into a climb or a loop, it can perform a loop, and of course in real life scenario of vertical loop, lift is small and negligible, but drag isn't. I've heard various figures for the thrust to weight ratio of JF-17, but they're meaningless for comparison if they don't mention load-out and weight. I've heard the JF-17's t/w compared to Mirage 2000 and F-16.
In this video, at around 2 min mark, there's a clip of the JF-17 performing a short vertical climb, it's not a loop, but the first part is performed successfully. Interestingly enough PAF pilot at 2:04 mentions a thrust to weight ratio, but never have I seen these sort of figures reference a load-out or fuel.