All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
First of all, you should know that implementing the Hadd (corporal punishment prescribed by the Sharee‘ah) on a person who committed fornication is not a condition for the validity of his repentance. Instead, it is sufficient for him to repent to Allah, The Exalted, secretly, and it is recommended for him to conceal his sin. It was narrated on the authority of ‘Abdullah ibn ‘Umar that the Prophet, sallallaahu ‘alayhi wa sallam, said: “Avoid this filth (referring to fornication) which Allah has forbidden; if anyone commits it, let him conceal himself with the concealment of Allah, and let him repent to Allah, for whoever discloses to us his hidden sin, we shall implement the punishment prescribed in the Book of Allah, The Exalted, on him.” [Al-Haakim and Al-Bayhaqi] It is noteworthy that only the ruler is authorized to implement the Hadd, and this duty is not assigned to the public, as stated by scholars.
If a person who committed fornication repents, it is permissible for him to marry a chaste woman. Accordingly, this marriage is valid as long as it fulfilled the conditions for a valid marriage in Islam.
The Hadeeth about which you are asking is authentic and was narrated by Ahmad and Abu Daawood . It refers to the fornicator who does not repent. Flogging was mentioned as an indication that that person is known for depravity. Al-Qurtubi said in his Tafseer book: “Ibn Khuwayz Mindaad said, 'The Hadeeth mentioned the flogged person to indicate that he is known for his dissoluteness.’” [End of quote]
Allah Knows best.