Praise be to Allah.
Fasting after 15th Sha’ban
It was proven that the Prophet (peace and blessings of Allah be upon him) said: “When Sha’ban is halfway through, do not fast .” Narrated by Abu Dawud (3237); Ibn Hibban (1651); classed as sahih by al-Albani in Sahih al-Tirmidhi.
Exceptions to prohibition not to fast after 15th Shaban
There are some exceptions from this prohibition, as follows:
1- One who has a habit of fasting, such as a man who habitually fasts on Mondays and Thursdays , which he may do even after halfway through Sha’ban. The evidence for that is the words of the Prophet (peace and blessings of Allah be upon him), “Do not anticipate Ramadan by fasting one or two days before it , except a man who fasts regularly, who should observe his usual fast.” Narrated by al-Bukhari, 1914; Muslim, 1082.
2- A person who started fasting before halfway through Sha’ban, and connects what comes after the halfway point to what came before. This is not included in the prohibition either. The evidence for that is the words of ‘Aishah (may Allah be pleased with her) who said: “The Messenger of Allah (peace and blessings of Allah be upon him) used to fast all of Sha’ban and fast all of Sha’ban except a little.” (Narrated by al-Bukhari, 1970; Muslim, 1165. This version narrated by Muslim)
“He used to fast all of Sha’ban and fast all of Sha’ban except a little.” The second phrase is an explanation of the first, pointing out that by “all” what is meant is “most”.
This hadith indicates that it is permissible to fast after halfway through Sha’ban, but only for one who joins that to what came before the halfway point.
3- An exception from this prohibition is also made for one who is making up missed Ramadan fasts .
Al-Nawawi (may Allah have mercy on him) said in al-Majmu’ (6/399):
“Our companions said: it is not correct to fast on the “day of doubt” just before Ramadan, and there is no difference of scholarly opinion on this point … But if a person fasts it to make up a missed day or to fulfil a vow, or as an expiation, that is acceptable, because if it is permissible to observe a voluntary fast on that day, it is more likely to be permissible to observe an obligatory fast… and if a person has to make up a day from Ramadan, then he has to fast it, because the time left for him to make it up has become very short.”
The “day of doubt ” is the thirtieth of Sha’ban if it has not been possible to sight the moon of the thirtieth because of cloud, fog, etc. It is called the “day of doubt” because there is some doubt concerning it – is it the last day of Sha’ban or the first day of Ramadan?
In conclusion, there is nothing wrong with making up a missed Ramadan fast in the last half of Sha’ban. This is not included in the prohibition of the Prophet (peace and blessings of Allah be upon him) on fasting after halfway through Sha’ban.
So your fasting of those three days is valid, and you have to fast the remaining days before Ramadan begins.
And Allah knows best.