How could the "Church" know better today, rather than closer to the actual genesis of the epistles when Paul was considered as the true author and was acknowledged by church theologians within the first century? And, are you finally admitting that the "infallible" Magesterium that comprised the infallible articles of the Council of Trent were not all that infallible? Quite an admission on your part.
A two part question. Our interaction is proving to be advantageous.
First, we have the ability to correlate all known versions of NT Scripture that was not available, and we have the wisdom of how the early Councils made their decisions w.r.t. naming the authors.
Second, the infallibility extends to the Faith and the teaching of it. Authorship was not considered by Biblical era Jews to be a great and worthy thing. I don't believe that most of the OT authors are reliably named either. Since the authors of other than some of Paul's Epistles are tentative at best (who was Jude?), that is consistent with the times. The Church did its best, centuries later to put an identifying mark on each book as to authorship. What we didn't get is the version of the book, of which many of them had dozens as copyists either inadvertently or with direction, changed the text.