It most likely was not true.
As a Queen, there would have been many witnesses to the birth and you would assume that at least one would have written it in their memoirs or diaries. The Queen did give birth to a a premature daughter after she had been ill for about a month. The baby was described as being dark violet in color when it was born. There is evidence that this child died in December 1664. Louis XIV sent a letter to other heads of state notifying them of the death of his daughter.
The possibilities for the myth of the black baby stem from one of two possibilities. One pertains to the Royal Coachmen and his wife, who were Maurish. The King and Queen were the godparents of the child and helped get her into the monastery. Having been the goddaughter of the King, she would.have referred to the Dauphin as her brother. The second possibility is that the child was born to a Moorish couple who were in the King's menagerie. The Queen was supposed to have helped her get into a convent.
Of the people who claimed or written about the Queen's black baby, only one was there, the duchesse de Montpensier and she only mentioned that the baby was premature and oddly dark. The others were either not there, Voltaire was born 30 years after the fact, Saint-Simon was born 10 years after the birth. La Montespan's account was written by another person from the memory of the story as told by La Montespan. Cardinal Dubois was the last "witness" who has it mentioned in his memoirs was also not at the birth, and most likely didn't write his own memoirs.