Gelasius declared the doctrine a heresy obliquely. And he did so by rejecting the book on the assumption of Mary. The book was declared apocryphal by Gelasius precisely because it accepted a doctrine which Gelasius rejected as false, in other words, 'heretical'. Why else would he have declared the book apocryphal? 

In the following century, Pope Hormisdas declared that anyone teaching this doctrine was a heretic.

You can read more about this in William Webster's 'The Church of Rome at the Bar of History', pp. 81-88.

Webster does not, in my opinion, make a definitive case for my statements. However, on the balance of probability, I believe the historical evidence strong enough to allow these statements to be considered at least plausible.