Ms Hainey, 38, had been sentenced to life imprisonment for the neglect and murder of 15-month-old Declan at their home in Paisley in December 2011.
The baby was found mummified in his cot in March 2010. He had last been seen alive eight months previously.
The Court of Appeal has now overturned Kimberley Hainey's convictions for murder and attempting to evade justice, and the Crown Office said it would not be looking to implement a retrial.
It was alleged that heroin addicted mother had abandoned the little boy for long periods of time, leaving him without food or drink while she took drugs.
At her trial, she said she had woken up one morning to find her son dead in his cot. Her defence QC Edward Targowski said she had not reported his death because she 'simply went into a downward spiral'.
After she was found guilty, her legal team launched an appeal claiming the crucial evidence against her was flawed.
Her lawyer disputed claims by expert witnesses who said marks on Declan's bones were signs of malnutrition. The appeal judges heard that during the 26-day trial the jury were presented with what appeared to be damning evidence.
But forensic anthropologist Susan Black admitted in court that she had no medical qualifications. Professor Black's findings had been supported by Dr Craig Cunningham, who turned out to be her PhD student, and also unqualified.
The appeal was heard at the Court of Criminal Appeal in Edinburgh by Lord Clarke, sitting with Lords Mackay of Drumadoon and Drummond Young on Wednesday. Lord Clarke concluded the conviction was to be overturned.
"The court has come to the conclusion that the conviction of the appellant (Ms Hainey) of the murder of her baby son, Declan must be quashed," he said.
The BBC reports that Lord Clarke said: "Putting matters colloquially, it cannot be right for a trial judge to allow an obvious 'quack' doctor to speak to a subject in a supposed expert way in relation to which he has no qualifications."
Lord Clarke also told Ms Hainey that under the circumstances, the second charge against her, of attempting to pervert the course of justice, for which she had been sentenced to seven years, was also quashed.
A Crown Officer statement revealed they would not be looking for a retrial in case: "Having reflected on the court's opinion and the available admissible evidence the Crown has decided it would not be appropriate to apply for a retrial," they said.
Suggested For You
SUBSCRIBE AND FOLLOW
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements.Learn more