If the contract wasn't fair, then you shouldn't have signed it, or should have negotiated it. Once you signed it, you agreed to it, fair or unfair. I understand your reason for quitting, but if they enforce the contract, that is a consequence of the situation. I sounds like the consequence is a better outcome than staying in the job you couldn't function in.
I will echo being careful saying your mental health was so bad you couldn't work, the BON can take that as an admission that you are unfit to work as a nurse, when the reality is that perhaps you're better suited to a nursing job outside of the hospital.