According to Sahih Al-Bukhari 1936, the compensation for breaking the fast by having intercourse is to manumit a slave. If a person is not able to do so, then he or she must fast for two consecutive months. If a person is not able to fast for two consecutive months, then he or she must feed sixty poor people. If he or she is not able to feed sixty poor people, then he or she may give a basket full of dates in charity.
From the Bukhari's Sahih, it becomes obvious that these steps must be followed if a person breaks his or her fast by having sexual intercourse while fasting. However, it seems that there is a different command mentioned in Ibn Sa'ad Tabaqat Al-Kubra.
In Ibn Saad's Tabaqat Al-Kubra, volume # 2, page no. 275, it is stated:-
عن سعيد بن المسيب قال: خرج عمر بن الخطاب على أصحابه يوما فقال: أفتوني في شيء صنعته اليوم! فقالوا: ما هو يا أمير المؤمنين؟
قال: مرت بي جارية لي فأعجبتني فوقعت عليها وأنا صائم! قال: فعظم عليه القوم وعلي ساكت. فقال: ما تقول يا ابن أبي طالب؟ فقال: جئت حلالا ويوما مكان يوم! فقال: أنت خيرهم فتوى
Saeed bin Al-Musayyib narrated:
One day Umar bin Khattab paid a visit to his companions and told them that he has done something and he wanted a Islamic ruling about that particular matter. So they asked him, "O leader of the believers! What is the matter?" He replied, "Today a slave girl was passing by me, and I found her attractive, so I had intercourse with her even though I was fasting at that time." The companions disliked what he did. Ali (Radhi'allahu'anhu) remained silent, so Umar asked him if he has something to say about it. Ali (Radhi'allahu'anhu) replied, "You have done a halal act, so you can fast for equal number of days (i.e. compensate by fasting for equal number of days on which the fasts were broken). Umar said, "Your verdict is the best one."
Please note that I found this narration in Urdu language and I have translated it, so I am not sure if this particular narration is accurately translated or not.
So what exactly is the compensation for breaking a fast by having intercourse intentionally? Is there any contradiction here? If no, then what is the correct explanation for the Hadith mentioned in Ibn Saad's Tabaqat Al-Kubra??