I keep getting this error when trying to submit a form in preview mode of wix code
You get that because some of the fields validation fails. This means that you might have a text type input form element on your page but that is actually a number type in your Data Collection. You must make sure that all types in your form is made compatible with the field types in your Data Collection. When you have fixed that it will work.
Did you set user input validations?