[Form] Improve exception message in config builder when data class is invalid

[Form] Improve exception message in config builder when data class is invalid

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12359
| License       | MIT
| Doc PR        |