The construction is a delayed subject with an expletive "it". Without the expletive:
To make mistakes is OK
Not to learn from them is not OK
In each case the subject is clearly a nominal infinitive phrase.
There's already been a question about the construction "to not" in the last few days. It is not acceptable. Please remember: To be or not to be, that is the question.
Student or Learner