The way I learned it is that Scripture has value if it conforms to the Apostolic teaching that was passed down, which we summarize nowadays in the Apostles’ Nicene, and Athanasian Creeds.
And if a book does not conform to the teaching of the Apostles (who were taught by Jesus, and which we can also see in their own words in the letters that were preserved), it’s not canonical.
But people just don’t seem to like having to think deeply about these kind of things...
However, Martin Luther thought the Epistle of James did not conform to the teaching of Romans.
You know?
It just seems a shame that Mary has had to appear SO many times on Earth to clear matters up.