You have an overbroad idea of Catholic faith practice.
The reason St. John Vianney was so remarkable is that huge numbers of people in his country had not been confessing, or going to church, or bothering with following God’s laws at all, when he came along.
His pastoral assignment was a very sinful village that was likely typical of a thousand other sinful locations in France (which had just been through a prolonged period of revolution and anti-clericalism and the Church had been underground and many priests had run away or been killed off).
And many of those locations didn’t even have a priest so there was no place for people to confess or go to church and over time they just didn’t bother.
The same type of situation happened in many locations all over Europe and Asia.
Yes, there have also been times and places where Catholics were more devout, but it varies, widely.