All scholars agree that such a fast is prohibited. It does not matter if the fast is obligatory or voluntary.
'Umar testifies: "The Messenger of Allah has forbidden fasting on these two days. Concerning the 'id of breaking the fast, it is for you to break your fast [of Ramadan]. On the 'id of sacrifice, you should eat from what you sacrifice." This is related by Ahmad,
an-Nasa'i, at-Tirmidhi, Abu Dawud, and Ibn Majah.