No you don't understand.
To prove a crime you need to prove all the elements of the crime. In the case of rape you need 2 elements: [sexual penetration] and [lack of consent].
Presume a woman pregnant with a mans child (not her husband) accuses that man of rape. She goes to the police to report it.
Element 1 (sexual penetration) is made out. She's pregnant with his child. Both parties make admissions to the police that the sex happened.
But she cant prove element 2 (lack of consent) as it's his word against her word and there is no other evidence to prove she did not consent. It's a 'he said, she said'.
She now gets flogged. She's admitted to having sex, outside of marriage, and that sex was proved to not be rape.
I understand what you are saying however I disagree that it was proved that there was no rape, for that to occur there would have to be some sort of proof that it was consensual, which there isn't.
All the court found was that there was not enough proof to say that it had happened. Rape can occur even when there is no hard evidence. Shocking, I know.
On the basis of the above, punishing someone for coming forward to report rape would fly in the face of any notion of fairness of justice unless it can be proved that it is a false accusation.