All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
There is no doubt that the Quran is the words of Allaah which is protected from any distortions and falsifications. Allaah Says (what means): {It is an honourable, fortified respected Book. Falsehood cannot come to it from before it or behind it: (it is) sent down by the All-Wise, Worthy of All-Praise (Allaah).}[Quran: 41:42] The doctor most likely means the above verse by what he has mentioned. As regards the verse mentioned (in the question), the interpreters of the Quran differed regarding its meaning. However, most of them agree that its meaning is, "Bad statements are attributed to bad people, and bad people are of bad statements, and good statements are attributed to good people, and good people are of good statements.”
Imaam Al-Qurtubi confirmed the above meaning and gave the evidence as the following verse, where Allaah Says (what means): {Such people are innocent of every bad which they say.}[Quran 24:26]
However, some other interpreters of the Quran stated that the verse means, "Bad women are for bad men, and bad men are for bad women, and good women are for good men, and good men are for good women.”
The Muslim scholars differed regarding marrying a fornicator or adulterer. The most preponderant opinion is that it is not permissible to marry him unless he repents. But if this really happens, this does not contradict the verse because the order of Allaah may happen and it may not happen. This is like the saying of Allaah (which means): {We sent no Messenger but to be obeyed with Allaah's leave.}[Quran 4:64] The Messenger could be obeyed and could be disobeyed. Thus, the verse does not have the meaning that you understood from it - that the two sides should be compatible.
Finally, we advise you of two matters:
Firstly, you have to advise your friend and remind him of Allaah and that he has to repent to Allaah from his sins.
Secondly, you should advise the parents of this woman to investigate the matter of this man and not to marry her off to him unless he repents.
Allaah Knows best.