I don't think that religious liberty is insanity is what Gregory XVII wrote in Latin, nor do I think were he alive today he would chose the exact words he chose in that time and place.

We were created by God to know Him, to love Him, and to serve Him in this world, and be happy with Him in the next.

He founded a Church through his Son Jesus Christ to provide the means for all men to accomplish this purpose.

If you know these things, you would have to be out of your mind to avoid his Church.

And that, I think, is what Gregory XVII was communicating in words appropriate to his milieu.