An oath of disobedience
Imaam al-Bayhaqi was a Shafi'i. He was a muhaddith. He is in no need of any introduction. He considered the following Hadiith weak:
إنَّ النَّذرَ نذرانِ : فما كانَ للَّهِ فَكَفَّارتُهُ الوفاءُ بِهِ ، وما كانَ للشَّيطانِ فلا وفاءَ لَهُ ، وعليهِ كفَّارةُ يمينٍ
The last portion of the Hadiith reads that the vow which is made for the devil (i.e. to do an act of disobedience) is not to be carried out and one is to give a kaffaarah for breaking the vow.
Websites like IslamQA use the above Hadiith. They use Sheikh al-albaani's grading to justify using the Hadiith. He considered it authentic in chain.
The majority of scholars do not act on this Hadith.
They act on the Hadiith in Sahih Muslim which has the following words
لا وفاء لنذر في معصية
لا نذر في معصية الله
al-Nawawi says:
النووي: وقوله صلى الله عليه وسلم "لا وفاء لنذر في معصية" و"لا نذر في معصية الله" كما هو في روايتنا السابعة وملحقها -قال: في هذا دليل على أن من نذر معصية، كشرب الخمر ونحو ذلك، فنذره باطل، لا ينعقد، ولا تلزمه كفارة يمين، ولا غيرها، وبهذا قال مالك والشافعي وأبو حنيفة وداود وجمهور العلماء.
al-Nawawi said that he who takes a vow to do something which constitutes disobedience of Allaah like drinking wine, then his vow is baatil and is not enacted. It is not necessary for him to give a kaffaarah of breaking a vow.
This is the opinion of Maalik, al-Shaafi'i, Abu Hanifah, Daawud, and the majority of the scholars.