In this sentence, "to err" is an infinitive phrase. It functions as a subject of the sentence. An infinitive phrase begins with the word "to" followed by a verb.