'To err is human' sounds much better than 'erring is human' because it is a fixed phrase and the lexeme 'err' / 'erred' / 'erring' ... sounds odd in most other sentences. This skews an appraisal of idiomaticity for the general usages. And this questiion involves idiomaticity rather than grammaticality.
These Google ngrams only begin to hint at how much more frequently used sentences beginning with 'Swimming is' / 'Endurance swimming is' etc are than sentences beginning 'To swim is'. Checking on the first 20 examples from the 1996 - 2008 sample interval for 'swimming is' reveals mostly relevant examples, while all the first 20 examples from the 1982 - 2008 sample interval for 'to swim is' are false positives like 'Learning to swim is ...'.
So, while 'To err is human' is the idiomatic (natural sounding) choice and 'Erring is human' sounds smart-alecky or amateurish, only set expressions like
(and perhaps in rare contexts 'to be or not to be'), and examples in formal and especially literary / oratorical registers, sound reasonable; the -ing form variants are far more colloquial (and do occur in at least one fixed expression):
- Seeing is believing.
- Growing old is mandatory, but growing up is optional.
- Smoking is forbidden in the hospital grounds.
- [Endurance] swimming is a fine way to keep fit.
- Making mistakes is an integral part of the human condition.
However, sometimes the to-infinitive is the only choice available:
- 'To walk beside my father down Sixth Street was to hear the asphalt sing.'
(John Updike, The Centaur)
The -ing form here would be at best a garden-path invitation, setting us up for a participial clause rather than a subject. But this literary and formal usage works well here.