Confession (or rather the Sacrament itself) is not a magical incantation. What is involved is that someone who has sinned, and is truly sorry for his or her offence, approches the Sacrament, confesses his or her sin with the intention of giving up that sin. If you attempt to marry a second person regardless of what Jesus, or the Church teach, knowing that it is sinful, and continue to live in that sinful life, there is little evidence that you want to give up sin.
Now the other side of this is Annulment. As mentioned above the New Testament speaks of Pornia. Or something that caused the marriage to be invalid from the first moment. (A bit in a minute about sin, but first Null and Void acts.) If there was something that caused the marriage to never be a Sacramental marriage, then it one would be free to marry in what may appear to be a second marriage. If someone has been granted a civil divorce, they really should have the marriage investigated by the Church to see if there was a valid marriage in the first place. You’ve brought up adultery as an example. Let’s say that one or both of the parties had not intended to marry “til death do us part.” and had witheld from the priest/deacon and their marriage partner that they did not believe that marriage was indisolvible, and a manogomous state. If one or both of the parties was drunk, taking drugs, or forced into the marriage. If one or both of the parties was too immature to make a commitment, there are several reasons why a marriage may never have really taken place. If such an impediment, or reason to prove that there was something that prevented the marriage from being a Sacramental Marriage, but only a civil contract, even if preformed in a Church, by a priest or deacon who had faculties to marry, then the marriage is not a Sacrament and could be declared to never have Sacramentally taken place.
As to those who have a problem with scruples, or are always worried if the Sacraments they recieve were valid, (like absolution in the confessional) and sadly there are those who suffer from this spiritual and psychological illness. To sin, one must know it offends God and will to offend Him. So if one is married, and there was a real impediment to a valid marriage, the couple has not sinned as they did not intend to live in sin, and believed that they were really married. The situation can be corrected if they find out about the impedement.