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.
What the questioner asks about is not a Hadeeth, and it has no origin. When the person makes a vow to commit a sin, it is incumbent on him to break it (it is forbidden to deliver on such a vow). The Prophet, sallallaahu ‘alayhi wa sallam, said: "Whoever vowed to obey Allaah, the Exalted, must do so, and whoever vowed to disobey Allaah, the Exalted, should not disobey Him." [Al-Bukhari]
‘Imraan reported that the Prophet, sallallaahu ‘alayhi wa sallam, said: "A vow to do an act of disobedience to Allaah, the Exalted, must not be fulfilled." [Muslim]
The person who vows to commit a sin should not do anything but turn to Allaah, the Exalted, in repentance. This is the opinion of Ash-Shaafi‘i, Maalik, and the majority of Muslim scholars .
Imaam Abu Haneefah believed that the person should offer expiation like that for breaking an oath as well. He depended on the Hadeeth that reads, "A vow to do an act of disobedience to Allaah, the Exalted, must not be fulfilled, and its expiation is the same as that of breaking an oath." [An-Nasaa‘i] As for fulfilling such a vow by committing the very sin that he vowed to commit, none of the scholars have ever said that, and it cannot be suggested by any sane person.
Allaah Knows best.