I have in the past made a jelly that didn’t gel. We re-opened the jars and re-boiled, as you describe. Of course, we also re-sterilized the jars and everything, and just started fresh. We didn’t add pectin, we just made sure to do the boiling properly the second time around so that it got to the right temperature. However, if you wish to add pectin, you could do it that way as well. In short, yes, your idea should work, or at least won’t hurt.