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 is His slave and Messenger.
Perhaps what you mean is the hadeeth reported by At-Tabaraani and narrated by ‘Uthmaan ibn Abi al-‘Aas in which the Prophet said, “The gates of heaven are opened in the middle of the night and a herald calls out, 'Is there anyone supplicating so that he may be answered? Is there anyone asking so that he may be granted? Is there anyone afflicted so that he may be delivered?' At that time, there is no Muslim who invokes for anything but that Allaah answers him, except for an adulteress who runs after her pleasure with her vagina or a tax-taker.”
This hadeeth was classified by Al-Albaani as dha’eef (weak) in Dha’eef At-Targheeb because all the narrations of this hadeeth were reported by ‘Ali ibn Zayd ibn Jud'aan, and he is a weak reporter. Also, Al-Hasan narrated it from ‘Uthmaan ibn Abi al-‘Aas, and there is a difference of opinion about whether or not he heard ahaadeeth from him.
In any case, what is meant by zina (fornication or adultery) in this hadeeth – if we were to presume that it is authentic – is the actual physical sex and not the figurative one, as it is explicitly stated, “Who runs after her pleasure with her vagina;” which is the prostitute who earns her living by committing zina; we seek refuge in Allaah from this.
Allaah knows best.